Versions Compared

Key

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

Status
colourYellow
titleDRAFT

Status
colourYellow
titleIN PROGRESS

Introduction

Directive Sets are a way of providing a simple and secure way to drive issue changes from links in generated email notifications to achieve anything from simple custom field value changes, to more complex workflow.  The links generated only have a security token, no arguments are supported, meaning that the links can only be used for exactly the purpose intended, one link per action.  An Email can have many such links covering a variety of field values or actions.  Here is a high level overview of the flow, showing the following flow:

...

These are the hyperlinks that are associated with a Directive Set and are validated using single-use tokens, meaning that only recipients of the notification will be able to use the Directive Set.

Each link in a single outbound notification is put in a Link Group which is unique to that recipient.  Once a link has been processed by JEMH Cloud, it (and others in that link group) will expire.  If 30 days pass without a link from an individual notification being processed, then this will also cause all related links to expire.

 


Note

Directive Sets use Directives, so make sure you understand how they work before attempting to use this feature. If changes aren't applied:

  • Check the JEMH Cloud Auditing → Message Inbound does not show any problems
  • Validate the Profile referred actually has Directives enabled, and the appropriate Field Processor for the body format used, e.g. At Prefix (the example used on this page)


Example Scenarios

...

  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  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="user.2.hydra@gmail.com")
    #set ($recipient=$jemhUtils.getRecipient())

    #set ($directSetLinkUrlHAPPY = $jemhDirectiveSetLinkManager.createDirectiveSetLink($groupId, $directiveSetIdHAPPY, $profileId, $issueKey, $cachEmailAddress, $recipient))

    #set ($directSetLinkUrlOK = $jemhDirectiveSetLinkManager.createDirectiveSetLink($groupId, $directiveSetIdOK, $profileId, $issueKey,$cachEmailAddress, $recipient))

    #set ($directSetLinkUrlUNHAPPY = $jemhDirectiveSetLinkManager.createDirectiveSetLink($groupId, $directiveSetIdUNHAPPY, $profileId, $issueKey, $cachEmailAddress, $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="user.2.hydra@gmail.com")
    #set ($recipient=$jemhUtils.getRecipient())

    #set ($directSetLinkUrlHAPPY = $jemhDirectiveSetLinkManager.createDirectiveSetLink($groupId, $directiveSetIdHAPPY, $profileId, $context.issue.key.textValue(),
        $cachEmailAddress, $recipient))


    #set ($directSetLinkUrlOK = $jemhDirectiveSetLinkManager.createDirectiveSetLink($groupId, $directiveSetIdOK, $profileId, $context.issue.key.textValue(),
        $cachEmailAddress, $recipient))

    #set ($directSetLinkUrlUNHAPPY = $jemhDirectiveSetLinkManager.createDirectiveSetLink($groupId, $directiveSetIdUNHAPPY, $profileId, $context.issue.key.textValue(),
        $cachEmailAddress, $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

 


Filter by label (Content by label)
showLabelsfalse
max5
spacesJEMHC
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "kb-how-to-article" and type = "page" and space = "JEMHC"
labelskb-how-to-article

Page Properties
hiddentrue
 
Related issues