The example provided in https://thepluginpeople.atlassian.net/wiki/spaces/JEMH/pages/114982925/Use+Directive+Sets#Managing-an-issue-workflow. Was considered before JSD Approvals were created.
It is possible to create a custom template based on the current JSM Approval notification as of JEMH version 2.7.0.
Table of Contents | ||||
---|---|---|---|---|
|
Prerequisites
Ensure that your JSM Project is setup/contains an issue type with a workflow that implements JSM Approvals.
...
JEMH version 2.7.0 as per comment https://community.atlassian.com/t5/Jira-Service-Management/JEMH-Allow-Approval-Through-Email-Permissions/qaq-p/657973 .
JEMH Profile
Directive’s enabled for Create and Comment more information: https://thepluginpeople.atlassian.net/wiki/spaces/JEMH/pages/33357890/Use+Directives#Enabling-directives.
The At Prefix Field Processor enabled more information: JEMH Mail Field Processors.
Documentation
Integrate JEMH with JSM https://thepluginpeople.atlassian.net/wiki/spaces/JEMH/pages/17104912/Integrate+JEMH+with+JIRA+Service+Desk#Use-of-Directives.
Understanding of: JEMH Posfunctions and how to apply them to Jira Workflow transitions: Use the JEMH Post Function.
Adding and customising templates to render said Post Functions:
Using Directive sets to drive the approval buttons: Use Directive Sets.
...
To create your Approved Directive Set go to JEMH>Event Listener>Directive JEMH> Notifications >Directive Sets and select Create Directive Set and enter the directives shown in the screenshots below.
...
Then in JEMH Configuration > Notifications > Jira user notification Project Mapping > Event Template Selection set the template to be your custom template set.
...
Step
...
4: Validate the email was created.
Run a test case (more information here: Use a TestCase for quick testing) to validate that approval links are being generated.
...
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.
...
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 ($approver in $approvers) #set($approverUser = $approver) ##Check if#set($approverEmail jira user is an approver #if($myApproversCustomField.contains($recipientUser)= $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 |