Introduction to Jira Automation and It’s Integration with Microsoft Azure Queue

Sujit Patil
Globant
Published in
4 min readMay 18, 2021

The goal of this article is to help to build out-of-box solutions with Jira Automation and Microsoft Azure Queue. We will cover how to configure Jira automation rules and send a message to Azure Queue through Jira Automation. This will be useful to automate an action. For instance, when an issue will be created, updated or deleted send details to Azure queue. Further we can develop any cross platform application to process this Azure queue message data.

Rule Example -

Automate any task or process with a few clicks

The Atlassian Jira offers a convenient way to implement powerful automation within Jira. Automation is implemented by defining so-called rules, which are combinations of triggers and actions.

The execution model in a nutshell: if the trigger “happens”, then the action is “executed”.

The simple way to automate and extend Jira. All power, no scripts.

1. Triggers -

Every rule starts with a trigger. They kick off the execution of your rules. Triggers will listen for events in Jira, such as when an issue is created or when a field value is changed.

Find below list of some triggers-

View the list of available triggers.

2. Conditions -

In which cases should automations be executed within Jira?

A Condition which allows users to choose whether the automated action will or will not be triggered.

Find below list of some conditions-

View the list of available conditions.

3. Actions -

Actions are, basically, the tasks we want to automate, and this integration enables automation. Example we can Send Email or Send Web Request.

Find below list of some actions-

View the list of available actions.

How to build rule

  1. Navigate to your Automation settings and select Create rule in the top-right corner.
  2. Select the Issue created trigger, and select Save.
  3. Select New condition, and select the Issue fields condition.
  4. Configure the condition as follows:
    Set the Field to Issue Type
    Set the Condition to equals
    Set the Value to compare to Bug
    Select Save.
  5. Select New action, and select the Create sub-tasks action.
  6. Configure the action as follows:
    Add 3 sub-tasks, called Inspect code, Troubleshoot and Resolve.
    Select Save.
  7. Select New action, and select the Assign issue action.
  8. Select a user to specify the assignee, and select Save.
  9. Give your rule a name, and select Turn it on.

How to build rules to send a message to Azure Queue?

We will cover the trickiest part of this rule, which is the REST API configuration. Considering this, let’s follow the steps below. We’ll explain how to make this as we go:

  1. Webhook URL :

Azure Queue is addressable using the following URL format-

https://<storage_account>.queue.core.windows.net/<que_name>/messages

2. Webhook Header :

Add the Header with Authorization

Authorization: SharedAccessSignature sr=https%3a%2f%2fazure.servicebus.windows.net% queue_name %2fmessages&sig=y8Vet1A9EjfvxfJDWKi2c0yXOwgY82VQNlCUL7vMz4c%3d&se=1925297008&skn=RootManageSharedAccessKey

To send requests to Azure queue we need to provide SAS authorization token. To know more check Storage-SAS-overview and #Generating_a_SAS_Token

3. Webhook Method :

POST

In this case, we’ll send the web request by POST, however, it’s possible to use other methods like GET, PUT, DELETE.

4. Webhook Body :

We can choose the variables to include and customize our payload. Select “Custom data” from webhook body dropdown list.

{
“issueId”: “{{issue.id}}”,
“issueKey”: “{{issue.key}}”,
“issueType”: “{{issue.issueType.Name}}”,
“summary”: “{{issue.summary.jsonEncode}}”,
“description”: “{{issue.description.jsonEncode}}”,
“reporter”: “{{issue.reporter.emailaddress}}”,
“priority”: “{{issue.priority}}”,
“createdOn”:”{{issue.created}}”,
“updatedOn”:”{{issue.updated}}”,
“assignee”:”{{issue.assignee.emailaddress}}”,
“status”:”{{issue.status.Name}}”
}

Smart values allow to access and manipulate issue data within Jira. What are smart values?

5. Rule Output:

The last step is to save the rule and enable it. Whenever there is new issue created this rule will send http request to Microsoft azure queue with all issue details in JSON payload format.

Hope that this article helps everyone! :)

--

--