Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleJIRA - GENERIC - Directive Links Macros
#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
titleSERVICE DESK - Directive Links Macros
#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 VariableExample ValueDescription
$groupId
8f5f485b-7496-4f4b-a0fc-3e37269704bcThis 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
10This 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
20This 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-123The issue key of the issue where the action will be performed. Value is generally $context.issue.key.textValue().
$cachEmailAddress$catchEmailAddress
myprofile@company.comAn email address that matches one of the profile's catch email address. 
$recipient
myuser@mail.comThe email address of user that will perform the action, generally the current recipient $jemhUtils.getRecipient().

...

  1. Create the Directive Set in Notifications → Directive Set 
  2. Remember the id of the Directive Set (first column on table)
  3. Go to Notifications → Custom Macros and Edit. Add the macro below (replace parameters $directiveSetId, $profileId, $cachEmailAddress$catchEmailAddress) and save. 
  4. Create an Issue and inspect the generated email. The email should have the Assign to Juan link
  5. 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
titleJIRA - GENERIC - Assign to Juan Custom Macro
#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

...

  1. Create Select List (single choise) custom field in Cog → Issue → Custom Fields → Create
  2. Add field to project's screen
  3. Create 3 Directive Sets in JEMH Cloud →Notifications → Directive Sets


  4. Directive Sets page should looks like this 
  5. 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:
  6. Then, an email sent to your customer will include the 3 icons + links. 
  7. When the user clicks in one of them, the Directive Set will be executed invalidating the other links.

...

Code Block
titleJIRA - GENERIC - Custom Satisfaction Custom Macros
#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
titleSERVICE DESK - Customer Satisfaction Macro
#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

...