...
Code Block | ||
---|---|---|
| ||
#macro (jemhIncludeDirectiveSetLinks) #set ($groupId = $jemhDirectiveSetLinkManager.generateGroupIdForEvent($context)) #set ($profileId=13) #set ($directiveSetId=3) #set ($issueKey=$context.issue.key.textValue()) #set ($cachEmailAddress$catchEmailAddress="user.2.hydra@gmail.com") #set ($recipient=$jemhUtils.getRecipient()) #set ($directSetLinkUrl = $jemhDirectiveSetLinkManager.createDirectiveSetLink($groupId, $directiveSetId, $profileId, $issueKey, $cachEmailAddress$catchEmailAddress, $recipient)) #if($directSetLinkUrl) <tr> <td class="email-content-main mobile-expand wrapper-special-margin"> <a href="$directSetLinkUrl" target="_blank">$jemhDirectiveSetLinkManager.getDirectiveSetName($directiveSetId)</a> </td> </tr> #end #end |
...
Code Block | ||
---|---|---|
| ||
#macro (renderDirectiveSetLinks) #set ($groupId = $jemhDirectiveSetLinkManager.generateGroupIdForEvent($context)) #set ($profileId=13) #set ($directiveSetId=3) #set ($issueKey=$context.issue.key.textValue()) #set ($cachEmailAddress$catchEmailAddress="user.2.hydra@gmail.com") #set ($recipient=$jemhUtils.getRecipient()) #set ($directSetLinkUrl = $jemhDirectiveSetLinkManager.createDirectiveSetLink($groupId, $directiveSetId, $profileId, $issueKey, $cachEmailAddress$catchEmailAddress, $recipient)) #if($directSetLinkUrl && !$context.webhookEvent.textValue().equals('jira:issue_deleted')) <tr> <td class="label" style="padding: 5px 0; color: #707070; width: 120px; padding-right: 10px; font-size: 14px"> Some Label For The Link </td> <td class="value" style="padding: 5px 0"> <table style="width: 100%; font-family: sans-serif"> <tbody> <tr class="sd-email-user-tagged"> <td> <a href="$directSetLinkUrl" target="_blank" style="text-decoration: none; color: black; cursor:pointer;"> $jemhDirectiveSetLinkManager.getDirectiveSetName($directiveSetId) </a> </td> </tr> </tbody> </table> </td> </tr> #end #end |
...
Example Variable | Example Value | Description |
---|---|---|
$groupId | 8f5f485b-7496-4f4b-a0fc-3e37269704bc | This is an id that is used to relate a set of links, such that when one link is used, the others are inherently expired/voided. An email may have several groups of links. |
$directiveSetId | 10 | This integer value must refer a known ID value shown in the DirectiveSet section of the JEMH Cloud Notification page. It refers to the set of Directives that will be applied. |
$profileId | 20 | This integer value must refer a known profile ID value shown in the JEMH Cloud Profiles page. It will be the profile that will be used for processing the DirectiveSet defined in $directiveSetId, as the $recipient on the $issue. |
$issueKey | ABC-123 | The issue key of the issue where the action will be performed. Value is generally $context.issue.key.textValue(). |
$cachEmailAddress$catchEmailAddress | myprofile@company.com | An email address that matches one of the profile's catch email address. |
$recipient | myuser@mail.com | The email address of user that will perform the action, generally the current recipient $jemhUtils.getRecipient(). |
...
- Create the Directive Set in Notifications → Directive Set
- Remember the id of the Directive Set (first column on table)
- Go to Notifications → Custom Macros and Edit. Add the macro below (replace parameters $directiveSetId, $profileId, $cachEmailAddress$catchEmailAddress) and save.
- Create an Issue and inspect the generated email. The email should have the Assign to Juan link
- If you click the link, the directive will be executed and the issue's assignee changed. The response is generated based on the Directive Set's template.
Code Block | ||
---|---|---|
| ||
#macro (jemhIncludeDirectiveSetLinks) #set ($groupId = $jemhDirectiveSetLinkManager.generateGroupIdForEvent($context)) #set ($profileId=13) #set ($directiveSetId=6) #set ($cachEmailAddress$catchEmailAddress="user.2.hydra@gmail.com") #set ($recipient=$jemhUtils.getRecipient()) #set ($directSetLinkUrl = $jemhDirectiveSetLinkManager.createDirectiveSetLink($groupId, $directiveSetId, $profileId, $context.issue.key.textValue(), $cachEmailAddress$catchEmailAddress, $recipient)) #if($directSetLinkUrl) <tr> <td class="email-content-main mobile-expand wrapper-special-margin"> <a href="$directSetLinkUrl" target="_blank"> $jemhDirectiveSetLinkManager.getDirectiveSetName($directiveSetId)</a> </td> </tr> #end #end |
...
- Create Select List (single choise) custom field in Cog → Issue → Custom Fields → Create
- Add field to project's screen
- Create 3 Directive Sets in JEMH Cloud →Notifications → Directive Sets
- Directive Sets page should looks like this
- For JIRA and GENERIC themes, insert #jemhIncludeDirectiveSetLinks macro below in Notifications → Custom Macros. For Service Desk theme, insert #renderDirectiveSetLinks macro below in Notification →Custom Macros. Update $profileId, $directiveSetIdHAPPY, $directiveSetIdOK, $directiveSetIdUNHAPPY and $cachEmailAddress and $catchEmailAddress to match your values. Custom Macros in Notification should looks like this:
- Then, an email sent to your customer will include the 3 icons + links.
- When the user clicks in one of them, the Directive Set will be executed invalidating the other links.
...
Code Block | ||
---|---|---|
| ||
#macro (jemhIncludeDirectiveSetLinks) #set ($groupId = $jemhDirectiveSetLinkManager.generateGroupIdForEvent($context)) #set ($profileId=13) #set ($directiveSetIdHAPPY=3) #set ($directiveSetIdOK=5) #set ($directiveSetIdUNHAPPY=4) #set ($issueKey=$context.issue.key.textValue()) #set ($cachEmailAddress$catchEmailAddress="user.2.hydra@gmail.com") #set ($recipient=$jemhUtils.getRecipient()) #set ($directSetLinkUrlHAPPY = $jemhDirectiveSetLinkManager.createDirectiveSetLink($groupId, $directiveSetIdHAPPY, $profileId, $issueKey, $cachEmailAddress$catchEmailAddress, $recipient)) #set ($directSetLinkUrlOK = $jemhDirectiveSetLinkManager.createDirectiveSetLink($groupId, $directiveSetIdOK, $profileId, $issueKey,$cachEmailAddress$catchEmailAddress, $recipient)) #set ($directSetLinkUrlUNHAPPY = $jemhDirectiveSetLinkManager.createDirectiveSetLink($groupId, $directiveSetIdUNHAPPY, $profileId, $issueKey, $cachEmailAddress$catchEmailAddress, $recipient)) #if($directSetLinkUrlHAPPY || $directSetLinkUrlOK || $directSetLinkUrlUNHAPPY) <tr> <td class="email-content-main mobile-expand wrapper-special-margin"> #if($directSetLinkUrlHAPPY) <a href="$directSetLinkUrlHAPPY" target="_blank"> <img style="vertical-align:middle" src="$jemhUtils.inlineImage($jemhUtils.getImageUrl('font-awesome_smile-o'))"/> $jemhDirectiveSetLinkManager.getDirectiveSetName($directiveSetIdHAPPY)</a> #end #if($directSetLinkUrlOK) <a href="$directSetLinkUrlOK" target="_blank"> <img style="vertical-align:middle" src="$jemhUtils.inlineImage($jemhUtils.getImageUrl('font-awesome_meh-o'))"/> $jemhDirectiveSetLinkManager.getDirectiveSetName($directiveSetIdOK)</a> #end #if($directSetLinkUrlUNHAPPY) <a href="$directSetLinkUrlUNHAPPY" target="_blank"> <img style="vertical-align:middle" src="$jemhUtils.inlineImage($jemhUtils.getImageUrl('font-awesome_frown-o'))"/> $jemhDirectiveSetLinkManager.getDirectiveSetName($directiveSetIdUNHAPPY)</a> #end </td> </tr> #end #end |
Code Block | ||
---|---|---|
| ||
#macro (renderDirectiveSetLinks) #set ($groupId = $jemhDirectiveSetLinkManager.generateGroupIdForEvent($context)) #set ($profileId=13) #set ($directiveSetIdHAPPY=3) #set ($directiveSetIdOK=5) #set ($directiveSetIdUNHAPPY=4) #set ($cachEmailAddress$catchEmailAddress="user.2.hydra@gmail.com") #set ($recipient=$jemhUtils.getRecipient()) #set ($directSetLinkUrlHAPPY = $jemhDirectiveSetLinkManager.createDirectiveSetLink($groupId, $directiveSetIdHAPPY, $profileId, $context.issue.key.textValue(), $cachEmailAddress$catchEmailAddress, $recipient)) #set ($directSetLinkUrlOK = $jemhDirectiveSetLinkManager.createDirectiveSetLink($groupId, $directiveSetIdOK, $profileId, $context.issue.key.textValue(), $cachEmailAddress$catchEmailAddress, $recipient)) #set ($directSetLinkUrlUNHAPPY = $jemhDirectiveSetLinkManager.createDirectiveSetLink($groupId, $directiveSetIdUNHAPPY, $profileId, $context.issue.key.textValue(), $cachEmailAddress$catchEmailAddress, $recipient)) #if(($directSetLinkUrlHAPPY || $directSetLinkUrlOK || $directSetLinkUrlUNHAPPY) && !$context.webhookEvent.textValue().equals( 'jira:issue_deleted')) <tr> <td class="label" style="padding: 5px 0; color: #707070; width: 120px; padding-right: 10px; font-size: 14px"> Customer Satisfaction </td> <td class="value" style="padding: 5px 0"> <table style="width: 100%; font-family: sans-serif"> <tbody> <tr class="sd-email-user-tagged"> <td> #if($directSetLinkUrlHAPPY) <a href="$directSetLinkUrlHAPPY" target="_blank" style="text-decoration: none; color: black; cursor:pointer;"> <img style="vertical-align:middle" src="$jemhUtils.inlineImage($jemhUtils.getImageUrl('font-awesome_smile-o'))"/> $jemhDirectiveSetLinkManager.getDirectiveSetName($directiveSetIdHAPPY)</a> #end #if($directSetLinkUrlOK) <a href="$directSetLinkUrlOK" target="_blank" style="text-decoration: none; color: black; cursor:pointer;"> <img style="vertical-align:middle" src="$jemhUtils.inlineImage($jemhUtils.getImageUrl('font-awesome_meh-o'))"/> $jemhDirectiveSetLinkManager.getDirectiveSetName($directiveSetIdOK)</a> #end #if($directSetLinkUrlUNHAPPY) <a href="$directSetLinkUrlUNHAPPY" target="_blank" style="text-decoration: none; color: black; cursor:pointer;"> <img style="vertical-align:middle" src="$jemhUtils.inlineImage($jemhUtils.getImageUrl('font-awesome_frown-o'))"/> $jemhDirectiveSetLinkManager.getDirectiveSetName($directiveSetIdUNHAPPY)</a> #end </td> </tr> </tbody> </table> </td> </tr> #end #end |
...