Table of Contents |
---|
Summary
Scriptlets are used to provide pre-defined sections of Html content for Ad-Hoc notifications and are able to retrieve values from most all Jira Fields.
How Jira Fields
...
values are retrieved
Most Jira Fields can be accessed by using $issue.getField()
. However, Custom Fields require $issue.getCustomFieldValue("customfield_10116")
to gather their values. As the Custom Field Id’s are used to find the Custom Field value, it means that they will need to be changed within the Scriptlet to work within your Jira instance.
Example Scriptlet
This Scriptlet example gathers all of the Jira Field values and displays them in a format that is similar to the Jira Issue Page. There are This Scriptlet has two features that have been implemented within this Scriptlet to restrict any unnecessary content from being shown within the Ad-Hoc notification:
Check if Fields are empty.
...
Fields will not be shown when they are empty.
Check if comments are internal comments. If they are internal comment then they will not be shown. (This only applies to Jira Service Desk Projects).
Info |
---|
For the Request Participant and Organisation fields to be shown, the Custom Field Id’s must be changed within the Scriptlet to match your Jira instance. Custom Fields that are created by users will not be gathered by this Scriptlet and would require further configuration. |
...
Example Scriptlet File
View file | ||
---|---|---|
|
Importing the example Scriptlet
To import the Scriptlet go to JEMH > Template Sets > Templates > Import Template Set
and select the Downloaded Scriptlet file. This will then place the Scriptlet within the “Scriptlets for Ad hoc” section in Template Sets.
...
Inserting a Scriplet into a Ad-Hoc notification
To insert the Scriptlet into the Ad-Hoc notification pressInsert > Add Template
within the the text editor. This will then display the content into the Comment text editor.
...
Example Email that used this Scriptlet
Below is a demonstration of how the Scriptlet content is displayed within an email.
...