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 Next »

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

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.

Create a simple Ad hoc TemplateSet

Template Sets are composed of a Subject, TEXT content and separate HTML content.  Its more work to edit in HTML, examples are always given in TEXT.

(info) A 'twist' to configuration is that in order to 'easily' edit an adhoc Template, you will need to capture a Postfunction Webhook, but in order to do that you need to configure a JEMHC postfunction first.  The template set will be trivial to start with to prove basic configuration, then later more details can be added.

Create the TemplateSet

Navigate to JEMHC > Notifications > Template Sets, and select All Event Groups.  Pick a theme that you want this notification to be styled/associated with, in the example below, we have a copy of the JEMHC system JIRA theme called JIRA Support.

Clicking Create will popup the TemplateSet creation dialog, set the name, select the theme and TemplateSet Type, which should be Adhoc Notifications, and submit.

Then, its also possible to copy from an existing template of that nominated type in the nominated theme, or blank:

On Submit you will be taken to the TemplateSet editor:

Edit the Template Set

Scroll down the editor to get to the content section, its also possible to preview the content (below).  To get back to edit, just hit the same icon.

Edit TimePreview Time

Full details of the Velocity Context are also available in the UI, which are hyperlinked to external Javadoc sources:

Save the Template Set

Don't forget!

View the available Ad hoc Template Sets

Change the Event Group to 'Ad hoc Notifications'

Which then shows:

Create a JEMHC Postfunction

Verify notification

Next Steps

Preview Context

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:

(info) JEMHC has some editor autocomplete that allows you to drill into this structure:

 $context.<CTRL-SPACE>

With this, its possible to (later) build up an expression like $context.user.name, but thats the JSON object, to get the 'text' of the node, you also need to use .textValue(), so a subject could be:

$context.user.name.textValue() did something to $context.issue.key.textValue()

 

  • No labels