...
Step 3: Create a velocity snippet to add Directive Set links to your Adhoc Template Set.
You can follow the previous documentation: https://thepluginpeople.atlassian.net/wiki/spaces/JEMH/pages/3439984645/Driving+JSM+Approvals#Step-3%3A-Create-a-Custom-Template-Set-to-the-related-Events.if you are adding to a template set the difference being adding the velocity snippet to an Adhoc template set rather than an issue event template set.
Code Block |
---|
Note |
Ensure that only one recipient is present which the approver user picker customer field. This ensures that only the intended user receives the approval. |
For a post function adding to the Custom Content or selecting an Adhoc template set containing the following velocity snippet:
Code Block |
---|
##retrieve approver user from user picker custom field configured in your JSM Approvals #set($approvers = $customFieldManager.getCustomFieldObject("customfield_10122").getValue($issue)) #foreach ##Check if jira user is an approver #if($myApproversCustomField.contains($recipientUser)) ($approver in $approvers) #set($approverUser = $approver) #set($approverEmail = $approver.getEmailAddress()) #set ($approverUserKeyId = $approver.getKey()) #end ##generate directive set links #if($approverUser != $null) #rowWrapperNormal("#generateDirectiveSetLink('Approve', $userKeyId$approverUserKeyId, 1, 3)") #rowWrapperNormal("#generateDirectiveSetLink('Reject', $userKeyId$approverUserKeyId, 2, 3)") #end #end |