Versions Compared

Key

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

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

  1. Create a simple Ad hoc TemplateSet for use by the Postfunction with a static recipient
  2. Create a JEMHC Postfunction in an existing workflow
  3. Verify notification
  4. 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:

Image Added

Drill in to a Transition, here we use Start Progress:

Image Added

Click Add post function:

 Image Added

Select JEMHCloud, then Add.

Image Added

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:

 

Image Added

For testing I'm going to set a static addressee to start with in the TO: recipient tab:

Image Added

Now review the From tab, set a Sender Personal for the Postfunction notification if needed

Image Added

Check that the address is valid for the Configured Outbound Mailserver set in the Settings tab:

Image Added

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:

Image Added

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:

Image Added

After:

Image Added

Make the workflow active

Changes made so far are in a Draft of the workflow, time to publish:

Image Added

In testing I don't backup, you may want to:

Image Added

Now its active:

Image Added

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:

Image Added

Transition the issue

Hit Start Progress to trigger the transition, well then get the related traffic from JEMHC auditing to see what happened:

Image Added

In another window, navigate to JEMHC > Auditing > Events to see what happens, here, older events have been removed:

Before:

Image Added

After:

Apart from the Timestamp variance all looks well

Image Added

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:

Image RemovedImage Added

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:

Image Added

HipChat notification (doesn't indicate source, just the content of the event)

Image Added

Check the Mailbox, you should see something like this, highlighted are the values injected from the Postfunction Webhook:

Image Added

Next Steps: Fine tuning

With a TemplateSet in place, and communication validated, further configuration can be made:

...

 

Filter by label (Content by label)
showLabelsfalse
max5
spacesJEMHC
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("postfunction","adhoc") and type = "page" and space = "JEMHC"
labelspostfunction adhoc

...