JiraPlan, track, and manage your agile and software development projects
Jira is a proprietary issue tracking product developed by Atlassian which allows bug tracking and agile project management.
In a Terminal window, run the following openssl commands (please run the commands separately):
openssl genrsa -out jira_privatekey.pem 1024
openssl req -newkey rsa:1024 -x509 -key jira_privatekey.pem -out jira_publickey.cer -days 365
openssl pkcs8 -topk8 -nocrypt -in jira_privatekey.pem -out jira_privatekey.pcks8
openssl x509 -pubkey -noout -in jira_publickey.cer > jira_publickey.pem
This generates the files jira_privatekey.pcks8, jira_privatekey.pem, jira_publickey.cer and jira_publickey.pem.
Note that on Windows the
> jira_publickey.pem last part of the command may not work, in which case you can just use
openssl x509 -pubkey -noout -in jira_publickey.cer then copy the terminal output (including the
-------BEGIN PUBLIC KEY-------- and
-------END PUBLIC KEY-------- lines) and paste it into a file named
Log into your Jira instance and click Jira settings -> Products -> Application links from the sidebar menu:
In the "Enter the URL of the application you want to link" field, enter any URL and then click on Create new link. Ignore any warning about "No response was received from the URL you entered - it may not be valid.", just click on Continue.
On the first screen of the Link applications pop-up window, The Consumer Key and shared secret are user defined. When setting up an application link on the Jira side, you specify what the consumer key and shared secret should be. Then, on the Tray side, you need to put these same values in so that Tray is able to authenticate to Jira. Be sure to select the Create incoming link checkbox.
On the next screen of the Link applications popup window:
Enter the Consumer Key, Consumer Name and the Public key (copy the public key from the file jira_publickey.pem you generated previously). The Consumer Name is user defined, it's just for reference.
Then click on Continue.
You can now create a new authentication in the Tray workflow builder. You will use the following:
- The Jira URL (without / at the end)
- The Private key contained in the file jira_privatekey.pem
- The consumer key specified in the second screen of the Link applications popup window
- The shared secret specified in the first screen of the Link applications popup window
You can easily create a Username/Password authentication with Jira by using the 1.x version of the connector and specifying the username, password and your Jira URL (e.g. https://myjiradomain.atlassian.net).
The available operations for the connector:
Create issue comment
List issue comments
List project issues
The Jira connector supports two authentication methods: Username/Password and OAuth1. The Username/Password authentication is the simplest way to authenticate to your Jira instance, however it is less secure than OAuth1. On the other hand, OAuth1 requires some additional steps which are explained in the above paragraphs.
If you want to use a Username/Password authentication, then use the connector version 1.x
If you want to use a OAuth1 authentication, then use the connector version 2.x
As of version 2.3 it is now possible to effectively create your own operations.
This is a very powerful feature which you can put to use when there is an endpoint in Jira which is not used by any of our operations.
To use this you will first of all need to research the endpoint in the Jira API documentation, to find the exact format that Jira will be expecting the endpoint to be passed in.
Note that you will only need to add the suffix to the endpoint, as the base url will be automatically set (the base url is picked up from the value you entered when you created your authentication).
The base url is in the format of
For example say that the Get issue operation did not exist in our Jira connector and you wanted to use this endpoint, you would use the Jira API docs to find that the get issue endpoint is a get request at the following url:
So if you know that an issue key is 'DCP-165' you can get this issue with the following settings:
As another example, if you wanted to return the system and custom issue fields available in your Jira instance, the API docs tell you that this is a get request at the following endpoint:
So you can get this information just using the following setting:
Note: If you are using DELETE you will have to set the content type to 'application/json' if body type is none (which it will be in most cases)
Here in the Tray.io docs department we have a JIRA bot set up to send Slack notifications about documentation which has been put on hold or is ready to be published. These serve as reminders to make sure that nothing 'slips through the cracks'.
This is managed with a very simple workflow:
This workflow does the following:
- A scheduled trigger runs once a week
- Using JQL (Jira Query Language) a check is made for any docs tickets with a status of 'On Hold' or 'Ready to Publish'
- A loop connector goes through these tickets one-by-one
- The relevant 'docs-notifications' Slack channel is notified of each ticket
And the final output in Slack looks like this:
First the trigger is set to run at a certain time every week:
Next we can use the Search Issues (JQL) operation to build a filter using the Jira Query Language (JQL) :
Now we can use the loop connector and a
$.steps.jira-1.issues jsonpath to pick up the results which match the query and loop through each of them one-by-one:
Finally we can use interpolated mode to compose the Slack message using the jsonpaths which extract the relevant ticket metadata from each ticket in the loop step:
You can see that the message box corresponds with the messages that are then output to Slack:
Note that for the Slack Send message operation you can set Username and Icon url: