This How To will take you through the configuration of the JEMHC Postfunction to drive notifications in response to workflow changes.
Step-by-step guide
- Create a simple Ad hoc TemplateSet for use by the Postfunction with a static recipient
- Create a JEMHC Postfunction in an existing workflow
- Verify notification
- Next Steps: Field by Field Configuration of the Postfunction
Table of Contents |
---|
Info |
---|
Velocity is a Template language used by JIRA, and JEMHC. It allows dynamic injection of 'values' into a template, a process called rendering. Velocity markup is not hard to learn, and the helper tools made available in JEMHC should make it very powerful and flexible. |
...
Change the Event Group to 'Ad hoc Notifications'
Which then shows:
Create a JEMHC Postfunction
Navigate to JIRA Admin > Issues > Workflows. Edit the workflow:
Drill in to a Transition, here we use Start Progress:
Click Add post function:
Select JEMHCloud, then Add.
After a short time, the JEMHC Postfunction editor will be shown. Select an existing Ad hoc Template Set, the basic one created earlier will be in the drop down, remember to set TEXT as the format (as the example Template Set only provides that, and of course, the correct Ad hoc Template Set itself:
For testing I'm going to set a static addressee to start with in the TO: recipient tab:
Now review the From tab, set a Sender Personal for the Postfunction notification if needed
Check that the address is valid for the Configured Outbound Mailserver set in the Settings tab:
Saving the Postfunction
Due to how the layout currently works, the biggest 'page' of the configuration pushes the Submit button down, scroll down to find it:
Postfunction ordering
Initially the JEMHC Postfunction will be first in the list, this is not ideal because changes in the transition have not yet been applied. Move the JEMHC postfunction down until after the Issue has been re-indexed. Its a slow process as a page refresh is required each time, patience padawan!
Before:
After:
Make the workflow active
Changes made so far are in a Draft of the workflow, time to publish:
In testing I don't backup, you may want to:
Now its active:
Verify notification
Next Steps
...
verification should be as simple as transitioning an existing issue in the TO DO Status with the Start Progress Transition. I'm going to just create one:
Transition the issue
Hit Start Progress to trigger the transition, well then get the related traffic from JEMHC auditing to see what happened:
In another window, navigate to JEMHC > Auditing > Events to see what happens, here, older events have been removed:
Before:
After:
Apart from the Timestamp variance all looks well
It is at this point that the 'data' that was sent from JIRA in relation to the Postfunction transition can be captured as a Preview Context that will allow fine tuning of TemplateSets content (where content from the event is to be included in the Template).
Create a Preview Context for the Postfunction
A preview context can be created from captured Postfunction Webhooks. This is done in Auditing > Events > PostFunction Notification entries. Once Created they can be selected in the Editor (show previously), which can then be used within the template:
The content of the Preview Context is JSON and looks like this:
...
No Format |
---|
$context.user.name.textValue() did something to $context.issue.key.textValue() |
Verify emails were sent
JEMHC tracks recent sent email content, and allows preview of that content, in JEMHC > Auditing > Outbound Messages we see two notifications, one via Email to the statically defined recipient in the postfunction (notice the subject had the injected username set from the Postfunction Webhook data), and a second via the JEMHC HipChat integration:
HipChat notification (doesn't indicate source, just the content of the event)
Check the Mailbox, you should see something like this, highlighted are the values injected from the Postfunction Webhook:
Next Steps: Fine tuning
With a TemplateSet in place, and communication validated, further configuration can be made:
...
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...