Execute an action in JEMHCloud from a third party system using incoming webhooks

In Progress

Incoming webhook is a way of executing an action in JEMHCloud by triggering a secured URL. This will allow you to integrate JEMHCloud with a third-party system. The allowed actions are:

  • Send email notification for an issue. 

  • Delete an issue's external attachments. 

  • Send SMS Notification for an issue (TODO, does it make sense?)

  • Send Slack Notification for an issue (TODO, does it make sense?)

Once the webhook is set, the action can be executed by calling the secured URL.

The request must contain the security token as an HTTP request header or as a query parameter. The URL provided by JEMHCloud will include the token.

The request must contain the issue key. The issue key can be provided in a query parameter or in the request body. Examples:

  • ?issueKey=ABC-123

  • {"issue": {"key":"ABC-123"}}

  • {"issueKey": "ABC-123"}

  • {"key":"ABC-123"}

The request should contain the account id of the user that performed the action. The accountId can be provided in a query parameter or in the request body. Examples:

  • ?accountId=a-b-c-d

  • {"user": {"accountId":"a-b-c-d"}

  • {"accountId": "a-b-c-d"}

Let's see a use case that uses a great Jira App called Automation for Jira. The Automation for Jira documentation can be found here.

How to send a reminder email notification every morning to the assignee of "In Progress" issues.

For this use case, we will be using the free/lite version of Automation for Jira. To install the automation app. 

Install Automation for Jira

  1. Go to your Jira → Jira Settings → App → Find New Apps

  2. Search for Jira Automation Lite and install it 

Once you have the App installed, let's create a new incoming webhook action in JEMHCloud

Create the Incoming Webhook action in JEMHCloud

  1. Go to JEMHCloud → Messages → Message Outbounds. Confirm that you have created a mail server connection

  2. Go to JEMHCloud → Messages → Incoming Webhooks

  3. Enter a name and leave the Action to Send Notification and the Post method

  4. Enter the Message you want to add to the email notification body.

  5. Add the recipients, in this case, the team lead and assignee.

  6. Submit. The created Incoming Webhook will appear on the list.

  7. Click on "Show URL" and select and copy the full URL. Automation for Jira will call that URL when executing an Automation Webhook action.

You have created the JEMHCloud Incoming Webhook. If you call that URL providing the right Issue Key, JEMHCloud will send the notification to the configured recipients. The URL caller can be Automation for Jira or any other system, program or script that can hit an URL.

Try different a system theme/template or a custom themes/template for these notifications!

Create the Automation Rule

Now let's create the automation Rule. This rule will run every weekday at 7 AM and it will call the JEMHCloud Incoming Webhook URL we have just created.

  1. Go to your project → Project Settings → Create Rule 

  2. Select the Scheduled trigger

  3. Enter the Cron expression 0 0 7 ? * MON-FRI

  4. Enter the JQL rule status = "In Progress"

  5. Uncheck the last checkbox so all "In Progress" issues are reminded, not only the changed one

  6. Add a "Send web request" action

  7. Paste the JEMHCloud Incoming Webhook URL and enter the custom data template. The resolved issue key will be posted in the HTTP post request.

  8. Enter the Rule name and Turn it on

  9. To test the rule and the JEMHCloud integration, click on the "Run Rule". Revisit the Audit Logs to see if there is any problem.

  10. Go back to JEMHCloud  → Auditing → Event. The Incoming Webhook will be processed like any other issue and post function event. The email notification configuration is the one entered in the Incoming Webhook

  11. Go to the Cog icon in the event row, click on the View Report 

  12. The email notifications configured in Incoming Webhook should have been sent. This is how the email looks:

We are done! Now assignees will get notifications every morning about their current work. There is a big list of possible triggers you can use in Automation for Jira so you can customize when you want to notify your users.

Related articles