Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

IN DEVELOPMENT

In JEMHCloud, recipients can be added pragmatically using Velocity scripts. With this feature, JIRA users, JIRA groups and Email addresses can be dynamically added as recipients of Issues notifications, Ad Hoc notification or Post Function notifications.

The main use case of this feature is when you depend on the event's context (like the issue data) to add extra recipients. E.g.: Notify managers when the issue's priority is Critical.

It's recommended to use the standard recipients configuration (notify reporter, notify watchers, etc.) when the recipients are not conditional. 

Conditional recipients in Issue Notifications

To add conditional recipients in notifications, go to Notifications -> Issue and edit your mapping by clicking in the Cog icon.

Under the Additional Recipients header you can find the Recipients Script field.

The text area input supports Velocity scripts. Use Ctrl+Space to view the velocity's context ($recipientUtils's method, $context.issue, etc.).

Examples
##If issue priority is blocker and type is bug, notify JIRA user johnfixall
 
#if ($context.issue.fields.priority.name.textValue() == "Blocker" && $context.issue.fields.issuetype.name.textValue() == "Bug")
	$recipientUtils.addUserRecipients("johnfixall")
#end


##If issue is of project SD, notify email users devLead@mycompany.com and testLeader@mycompany.com


#if ($context.issue.fields.project.key.textValue() == "SD")
	$recipientUtils.addEmailRecipients("devLeader@mycompany.com,testLeader@mycompany.com")
#end

##If issue priority is Major, notify support level 3 group


#if ($context.issue.fields.priority.name.textValue() == "Major")
	$recipientUtils.addGroupRecipients("support-level-three")
#end

##If issue priority is Min, notify support level 1 and level 2 groups


#if ($context.issue.fields.priority.name.textValue() == "Minor")
	$recipientUtils.addGroupRecipients("support-level-one,support-level-two")
#end

##If operation was made by CEO user or issue reporter's CEO user, notify management


#if ($context.user.key.textValue() == "ceo" || $context.issue.fields.reporter.key.textValue() == "ceo" )
	$recipientUtils.addGroupRecipients("management")
#end

 

 
  • No labels