...
Setting Name | Description | ||||||
---|---|---|---|---|---|---|---|
Status | The status that the Directive Set will be saved in. If set to "disabled", subsequent links generated for the Directive Set will not be processed (but also not consumed). | ||||||
Name | The name of the Directive Set. This field is required, in order to help differentiate from others. | ||||||
Description | A description for the Directive Set can be added. This allows other administrators to understand its function. | ||||||
To Address | Enter the address which the directives should be sent to in order to be processed. This should usually be a "catch email address" on the target profile. | ||||||
Response TemplateSet | Allows selection of a template that will be used to render the response screen that a user is shown when they click on a directive set link. Information on creating these templates. | ||||||
Directive(s) | The directive content to be executed. It is recommended to enable the @prefix field processor, and use the respective format. An example is given when creating each Directive Set. | ||||||
The Directive Set link will redirect to the issue
| If checked, the Directive Set link forwards the user to the related issue. Otherwise, if unchecked, the Directive Set link will forward the user to the Directive Set Response. |
Notification templates
The DirectiveSetManager
can be interacted with as $jemhDirectiveSetLinkManager
below, to call createDirectiveSetLink
(this comes pre-built into JEMH's global macros, the below code does not need to be added):
...
If we take a look at the issue, we can see that the directive has been successfully processed and the issue has been transitioned to the "Rejected" status:
...
...
Reopening a closed issue - “The Directive Set link will redirect to the issue” example
Status | ||||
---|---|---|---|---|
|
The purpose of this example is to demonstrate the new “The Directive Set link will redirect to the issue” checkbox. By ticking the checkbox, email notifications containing DirectiveSet Links will redirect to the issue that the email notifications relates to, instead of your configured DirectiveSet Response TemplateSet.
Info |
---|
To receive the email notification, you must set up notifications, see: https://thepluginpeople.atlassian.net/wiki/x/RAA5B |
Create Directive Set
Go tothe Notifications tab in JEMH. You should see a section called Directive Sets. Select Create. You will then be taken to the creation screen:
Here we will set up our Directive Set as follows:
Select Create. You will then be brought back to the main Notifications page where you should see your new Directive Set:
Add DirectiveSet Link to Notification
Go to JEMH>Template Sets. Here, we will edit an existing custom template for the "Generic Event" issue event by selecting the edit action for the template.
The velocity macro is #generateDirectiveSetLink. The macro needs 4 parameters in order to work, and the parameters must always be in the same order:
Code Block | ||
---|---|---|
| ||
#generateDirectiveSetLink(LABEL,RUN AS USER KEY,DIRECTIVE SET ID,PROFILE ID |
For this example we are using the following:
Code Block |
---|
#rowWrapperNormal("#generateDirectiveSetLink('Reopen ticket',$userManager.getUserByName('admin').getKey(),2,44)") |
We are going to add the link in a row wrapper, so the DirectiveSet link is styled correctly. We, also, will add an if statement that checks the status of the issue is “Resolved”.
...
Submit your changes to the template by pressing the "save" button. Then, select the template for the corresponding event in the Notification Project Mapping, and save changes:
...
Validate configuration
We will now check that we have configured the DirectiveSetLink correctly.
Template set preview (when status of the issue is not resolved):
We can use the preview in Template Sets > Issue Event > Edit to verify whether the Directive Set Link will redirect. In the below instance, the issue LIL-112 is set to “resolved”, so “Reopen ticket” does appear.
Info |
---|
Note: the directive “@workflow=In Progress” will not apply if you test via the template set preview. |
...
By clicking the “Reopened ticket” link, if configured correctly, the DirectiveSet will redirect us to the associated issue. For example:
Template set preview (when status of the issue is resolved):
In this instance, in the preview inside Template Sets > Issue Event > Edit, the issue LIL-112 is not set to “Resolved”, so the Directive Set Link does not appear which is the expected outcome.
...
Email notification in email inbox sent by JEMH:
Info |
---|
Note: make sure your Issue Events Listener is configured so you receive email notifications. For more information, visit: Send notifications for Issue Events |
...
Similar to the template set preview, clicking “Reopen ticket” in an email notification will redirect us to the issue in Jira and apply the directive “@workflow=In Progress”.
...
JSD Approvals
This scenario Driving JSM Approvals. shows how the Directive Sets feature can be used to drive Jira Service Desk Approvals. Read more about Jira Service Desk Approvals here.
...
Such a notification would look like:
...
Adding a custom response template
By default, JEMH will use its own built in template. A custom template can be created, by going to JEMH>Template Sets and clicking the Directive Set Response tab. Then, click the + add button to create a new template. Click the pen icon to edit the template.
...