Filter JSM Request Participants



This script locates JSM Request Participants, and inhibits notifications to those users, such that JEMH notifications are only for Jira recipients, and JSM can continue to notify customers only...



## Sets $result to true if the current recipient is either the issue ## reporter or a request participant on the issue. #macro ( isCustomer $result ) #set ($result = false) #set ($recipKey = $recipientUser.getKey()) ## Is the recipient the creator of this issue? #if ($recipKey == $issue.getReporterId()) #set ($result = true) #else ## Is the recipient a request participant? RPs are stored in a ## custom field so we need to find it first #set ($cfName = "Request participants") #if ($!customFieldManager.getCustomFieldObject($cfName)) #set ($aCustomField = $customFieldManager.getCustomFieldObject($cfName) ) #elseif ($customFieldManager.getCustomFieldObjectByName($cfName) ) #set ($aCustomField = $customFieldManager.getCustomFieldObjectByName($cfName) ) #end #set ($rps = $issue.getCustomFieldValue($aCustomField)) #foreach ($rp in $rps) #if ($recipKey == $rp.getKey()) #set ($result = true) #end #end #end #end #set ($result = "") #isCustomer($result) #if ($result) $jemhUtils.setInhibitSending(true) $jemhUtils.setInhibitSendingReason("Not sent to customers") #else