Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Prerequisites

The following configuration requires an understanding of how to use custom notification templates in JEMH.  The wiki page for this information can be found here: Customize Email Templates.  Also, it is recommended that you have a basic understanding of how VTL (Velocity Template Language) is used.  Please refer to the Apache Velocity User Guide.

Configuration

The following velocity template will check if the notification recipient is in the customer project role.  If they are, it will render an HTML link that when opened, directs the user to the customer portal view of the issue that the notification is referring to.  If they are not in the customer project role, they will be shown a link to the standard JIRA issue:

#set ($roleList = $allRoles.getProjectRoles())
#foreach ($role in $roleList)
    #if ($role == "Service Desk Customers")
        #if ($allRoles.isUserInProjectRole($recipientUser,$role,$issue.getProjectObject()))
            <a href="${baseurl}/servicedesk/customer/portal/1/${issue.getKey()}">${issue.getKey()}</a>
        #else
            <a href="${baseurl}/browse/${issue.getKey()}">${issue.getKey()}</a>
        #end
    #end
#end

If you have multiple service desks, the service desk number in the URL will be different for each one.  If you only have one service desk, this should be using the number "1".  The below JSD API methods may be used to get the portal id dynamically.

 

Since JEMH v1.9.16, the following new JSD related API is exposed, your templates should be nullsafe here, if JSD is disabled, or inaccessible, a null value will be returned.

$jemhUtils.getJsdApi()

Test for a null value by using:

#if ($!jemhUtils.getJsdApi())
  your code here
#end

The API exposes the following methods:

	public List<RequestTypeBean> getRequestTypes();	
	public int getServiceDeskId(ApplicationUser u, Project p);
	public int getPortalId(ApplicationUser u, Project p);

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.

 

JEMH doesn't yet expose documentation of its own utility and API classes,  JEMH-4489 - Getting issue details... STATUS

  • No labels