Versions Compared

Key

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

...

Code Block
$issue

Retrieves the TemplateIssue, like Customising Jira Notifications.

Code Block
$issue.getReporter().getDisplayName()

This will get the name of the Reporter (An ApplicationUser Object).

Code Block
$issue.getAssigneeUser().getDisplayName()

This will get the name of the Assignee.

Code Block
#set($object = $customFieldManager.getCustomFieldObjectByName("Request participants"))
#set($cfv =  $issue.getCustomFieldValue($object))
#foreach ($reqpart in cfv)
  $reqpart.getDisplayName()
#end

This retrieves all Request Participant names from a Custom Field Value. This allows a list of all recipients by using all Watchers, Assignee, Reporter and Request participants. Organisations are also notified (and shown how to access below).

Code Block
#set ($watchers = $watcherManager.getCurrentWatcherUsernames($issue))
#foreach ($aWatcher in $watchers)
    $!aWatcher
#end

Accesses all watchers on the issue. Another ApplicationUser, Object type, meaning $aWatcher.getDisplayName() will return the name of each Watcher.

Code Block
$issue.getStatus().getSimpleStatus().getName()

Get the status of the issue. This can be used to send notifications on the change of workflow status.

Code Block
$comment.getAuthorApplicationUser().getDisplayName()

Gets the name of the user that just commented. This can be used to edit Issue Commented notifications.

Code Block
#set($lastComment = $allComments.getLastComment($issue))
$lastComment.getBody()

Gets the most recent comment added to an Issue.

Code Block
$jemhUtils.getJsdApi().getUnsubscribeCustomerNotificationUri($recipientUser,$issue)

Gets the Service Desk Management unsubscribe link for an Issue. Uses the $recipientUser to get the unique link for each user that is notified.

Code Block
$jemhUtils.getJsdApi().getJsdIssueLink($issue, $recipientUser)

Retrieves the JSD JSM Issue Link so all notified recipients can get an Issue Link.

The Issue Link goes to the JSD JSM portal view of the issue.

Code Block
$changelog.getRelated("ChildChangeItem")

This accesses the change log of all changes during the specific event, which gives the option to view all the changes, along with the changes that were made (old values compared to new values).

Using Issue Updated Event Listener for

...

JSM Notifications

Service Desk Management does not send Issue Updated notifications to customers like Jira does. However, JEMH can provide a ‘Default’ Issue Updated templates that can give Customers issue updated notifications in the style of Jira Service DeskManagement.

The following code will notify Users of many different events (if applicable), such as change in workflow status, Organizations being added to an issue, custom field value changes, and comment notifications. It will put all changed events into one notification if changed at once.

HTML

Code Block
<html>
    #parse("templates/com/javahollic/jira/jemh/email/theme/html/jsdheader.vm")
    <body>
        <div class="jsd-message-content">
            #set($needsBreakLine = false)
            #if($issue.getStatus().getSimpleStatus().getName() == "Resolved")
                #if($needsBreakLine)
                    <hr class="jsd-activity-item-separator">
                #end
                <p></p>
                <div class="jsd-activity-item-content">
                    <p>$!issue.getAssigneeUser().getDisplayName() resolved this as $issue.getResolution().getName()</p>
                </div>
                #set($needsBreakLine = true)
            #end

            #set($updateContent = $changelog.getRelated("ChildChangeItem"))
            #if($updateContent)
                #foreach($item in $updateContent )
                    <div class="jsd-activity-item-content">
                        #if($needsBreakLine)
                            <p></p>
                            <hr class="jsd-activity-item-separator">
                        #end
                        #if($item.get("fieldtype") == "custom")
                            #if($item.get("field") == "Organizations")
                                #set($organizations = $item.get("newvalue"))
                                #set($oldOrganizations = $item.get("oldvalue"))
                                #foreach($org in $organizations)
                                    #if(!$oldOrganizations.contains($org))
                                        #set($customers = $jemhUtils.getJsdApi().getCustomersFromOrg($recipientUser, $organization))
                                        #foreach($customer in $customers)
                                            #if($recipientUser == $customer)
                                                $issue.getAssigneeUser().getDisplayName() shared this with your organization.<br><br>
                                                View the request and select Get notifications to follow along.
                                            #end
                                        #end
                                    #end
                                #end
                            #else
                                Custom field $item.get("field") changed to $item.get("newstring")
                            #end
                        #else
                            $issue.getAssigneeUser().getDisplayName() changed $item.get("field") to $item.get("newstring")
                        #end
                        #set($needsBreakLine = true)
                    </div>
                #end
            #end
            <div class="jsd-activity-item-content" >
                #set($isComment = $comment.getBody())
                #if($isComment)
                    <hr class="jsd-activity-item-separator">
                    <p></p>
                    $comment.getAuthorApplicationUser().getDisplayName() commented:
                    #set($lastComment = $allComments.getLastComment($issue) )
                    $lastComment.getBody()
                    <p></p>
                #end
            </div>
        </div>

        <p>
            <a class="jsd-issue-link" href="$jemhUtils.getJsdApi().getJsdIssueLink($issue, $recipientUser)">
                View request
            </a>
            <span class="jsd-link-separator">&middot;</span>
            <a class="jsd-unsubscribe-link" href="$jemhUtils.getJsdApi().getUnsubscribeCustomerNotificationUri($recipientUser,$issue)">
                Turn off this request's notifications
            </a>
        </p>
        #parse("templates/com/javahollic/jira/jemh/email/theme/html/jsdsharedwith.vm")
    </body>
    <footer>
        <br>
        <p class="jsd-help-center-footer">
            Sent by <a href="https://marketplace.atlassian.com/apps/4832/enterprise-mail-handler-for-jira-jemh?hosting=cloud&tab=overview">JEMH</a>, Powered by <a class="jsd-servicedesk-link" href="https://www.atlassian.com/software/jira">Atlassian Jira</a>.
        </p>
    </footer>
</html>

TEXT

Code Block
$!issue.getAssigneeUser().getDisplayName() changed the status to $issue.getStatus().getSimpleStatus().getName()

#if($issue.getStatus().getSimpleStatus().getName() == "Resolved")
-----------------------------------------------------------------

$!issue.getAssigneeUser().getDisplayName() resolved this as $issue.getResolution().getName()
#end
#set($isComment = $comment.getBody())
#if($isComment)
-----------------------------------------------------------------
$comment.getAuthorApplicationUser().getDisplayName() commented:
#set($lastComment = $allComments.getLastComment($issue) )
$lastComment.getBody()
#end

#if($recipientUser == $issue.getReporter())
#if($issue.getStatus().getSimpleStatus().getName() == "Resolved")
How was our service for this request?
#set($feedbackDetails =  $!jemhUtils.getJsdApi().getRequestFeedbackDetails($recipientUser, $issue) )
#set($token = $feedbackDetails.getRequestFeedbackToken() )
☆ Very poor             ($!token.getCustomerPortalLink()&amp;rating=1)

☆ Poor                  ($!token.getCustomerPortalLink()&amp;rating=2)

☆ Neither good nor poor ($!token.getCustomerPortalLink()&amp;rating=3)

☆ Good                  ($!token.getCustomerPortalLink()&amp;rating=4)

☆ Very good             ($!token.getCustomerPortalLink()&amp;rating=5)
#end
#end

·View request           ($jemhUtils.getJsdApi().getJsdIssueLink($issue, $recipientUser))
·Turn off this request's notifications          ($jemhUtils.getJsdApi().getUnsubscribeCustomerNotificationUri($recipientUser,$issue))

#parse("templates/com/javahollic/jira/jemh/email/theme/text/jsdsharedwith.vm")

·Sent by JEMH (https://marketplace.atlassian.com/apps/4832/enterprise-mail-handler-for-jira-jemh?hosting=cloud&tab=overview)
·Powered by Atlassian Jira. (https://www.atlassian.com/software/jira)

...

Using the ‘Default’ Issue Updated notifications will send the customers a lot of notifications if the Issue is updated or worked on regularly. Service Desk Management does not send these notifications to customers.