Versions Compared

Key

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

...

Its therefore possible to query based on a given issues $issue.getProjectObject() and $receipientUser, to get the numeric portal ID that is hard coded above. 

Generate a dynamic link to the customer portal for service desk customers

Using the JSD API methods defined above it is possible to include a dynamic hyperlink within an issue notification that will link to the correct customer portal that relates to the issue. The following code will output a link the correct customer portal for the associated issue if the user is within the Service Desk Customers role and the JSD API is accessible. If neither of these conditions are met a fallback link is generated to the issue directly.

Code Block
#set ($roleList = $allRoles.getProjectRoles())
#foreach ($role in $roleList)
    #if ($role == "Service Desk Customers")
        #if ($allRoles.isUserInProjectRole($recipientUser,$role,$issue.getProjectObject()) && $jemhUtils.getJsdApi())
            #set($jsdApi = $jemhUtils.getJsdApi())
            #set($serviceDeskID = $jsdApi.getServiceDeskId($receipientUser, $issue.getProjectObject()))
                <a href="${baseurl}/servicedesk/customer/portal/${serviceDeskID}/">Click here to visit the customer portal!</a>
        #else
            <a href="${baseurl}/browse/${issue.getKey()}">${issue.getKey()}</a>
        #end
    #end
#end


JEMH doesn't yet expose documentation of its own utility and API classes, 

Jira Legacy
serverJIRA (thepluginpeople.atlassian.net)
serverId31e1f342-5dce-3979-a43c-85899d565476
keyJEMH-4489

...