Send a simple acknowledgement

Scenario

You would like to send a simple acknowledgement to your remote user in response to an email that created an issue through JEMH.

Challenges

Due to hwo JEMH has evolved, there is currently a two phase approach to issue creation, with custom fields coming in the second wave. As a result, the ISSUE_CREATED event in the JEMH Event Listener will fire but won't find the non-jira user email addresses that have yet to be stored, subsequent ISSUE_UPDATED events fire with that change.

Solution

To fire a specific event when JEMH creates an issue, and has completed populating all custom fields. Then, the JEMH Event Listener can be driven with this event to send an acknowledgement.

Walkthrough

In this tutorial we will:

  • Refer to how non-jira users details are stored by JEMH

  • Create a JIRA Custom Event

  • Refer to the JIRA Custom Event in a JEMH Profile

  • Create a JEMH TemplateSet for the JIRA Custom Event and add content

  • Create a JEMH Event Listener project mapping and tie the JIRA Custom Event to the JEMH TemplateSet

  • Execute a JEHM Test Case

  • Review results

Refer to how non-jira users details are stored by JEMH

See Enable non-Jira Account holders to receive issue updates and create/comment on Issues.

Create a JIRA Custom Event

Via the JIRA System screen, go to the Events section:

Add a Custom Event:

After:

Refer to the JIRA Custom Event in a JEMH Profile

The Custom Event needs to be selected in the JEMH Profile > Config > Notifications section:

Edit the Notifications section and select the Custom Event:

Save it:

Create a JEMH TemplateSet for the JIRA Custom Event and add content

The TemplateSet defines the content the user will receive, including Subject.

NOTE: To determine whether a remote user receives HTML or TEXT is defined within the JEMH Config > Email > Templates > Non Jira User notification format

Edit the TemplateSet as needed, the Subject and payload can be anything you like, the context will have access to the $issue, as shown below. Text or HTML can be provided, the selection of which is made in the listener, this just shows Text:

Create a JEMH Event Listener project mapping

JEMH Event Listener needs to have a mapping created that is used to filter incoming events to only specific projects, each project JEMH needs to support with the Event Listener has its own mapping. Create a new one one:

When creating the project mapping in the Event Listener, several fields need to be provided:

  1. Notification Format, value Text to match template content above.

  2. Project Key, value TEST (matching my local project)

  3. CSV email Custom Field, value Non JIRA Participants containing non-jira email addresses as configured in the Profile.

  4. JEMH Acknowledgement event, has the related event TemplateSet Simple acknowledgement selected

Execute a JEHM Test Case

Rather than waiting around for a real email, or even having JIRA hooked up, we can test everything works by creating a Test Case:

The example Profile has a default project TEST and a default reporter 'admin', so the test case will create an issue there, execute the test case to get details, this can either be done during a re-edit or from the TestCase screen:

NOTE: The Test Case is assocaited with a Profile, so the correct configuration is applied.

During editing

After saving

During editing

After saving

 

 

Running the Test Case shows the result screen, indicating the issue created:

Quickly switching to the JIRA Administration screen

The outbound queued message should be visible, check its subject v.s. the TemplateSet subject created earlier:

The received email, as text in this case will then be delivered:

Further steps

Now that simple acknowledgements are being sent back to the user, its also possible to create further Event mappings, e.g. ISSUE_COMMENTED to allow some degree of chatter back to the remote user.

Related articles