Tutorial - Communicate with Jira through UiPath

How to automate Jira Software with UiPath

If you are in the dev team and your role is developer, QA, BA, Project Lead, etc., or if you are a client, you must have interacted/used a bug tracking system. We have so many bug trackers and one of the most used tools is Atlassian’s Jira Software. How would it be if you can automate everything you do in Jira right from creating a ticket to the closure of the ticket with proper comments, sounds interesting right? :blush: So, if you want to do all that flawlessly through UiPath this blog is calling you.

So, what will you learn at the end of reading and following this tutorial?

  1. Creating project in Jira and generating API tokens
  2. How to perform the below operations in Jira with UiPath
    a. Create/Update/Delete Issue
    b. Assign Issue/ Update Priority
    c. Download/Upload attachments
    d. Add/Delete Comments

These are just a few of the operations that you will be seeing but trust me you can do much more with this.

So, what are we waiting for? Let us start.

Jira Software Setting –

I am assuming that you already have an account and some projects in Jira Software. If not, you can simply go to Jira/Atlassian website and register. After that, you can create a project which will be used during the interaction from UiPath.
To create a project just go to Projects in the menu bar and click on Create Project option

image

Great, you just created your first project. Now you can quickly create a test issue to which you can interact for a sample, to create an issue just click on Create Issue, fill in the necessary info, and you are done.

image

So far for the Jira setup, we are done here, we will come back here when we copy the API token which is needed to connect the Software with UiPath.
I think that was easy right? :blush: It will only take few minutes…

UiPath Automation –

First thing first, you need to install the Jira Software package in the studio first and for that, you know already, you will have to go to Manage Packages just type Jira select the package click on install then save.

Once done you will be able to see the Jira activities under Application → Integrations → JiraSoftware

image

Now, the most important thing we will have to create a connection between UiPath and JiraSoftware, and that we will do with UserName and API token from JiraSoftware. Remember you should use Jira Software Application Scope as your parent activity and inside this scope, only other related activities should be used, this will work as a container for other child activities which are nothing but you basic operations you do on issues.

image

Get API token from Jira -
To get the API token from Jira Software, in the application on the right-hand top click on your username initials, it will open a pop-up menu, in the menu click on the profile

image

It will open your basic profile page, there click on the “Manage Your Account” button

image

This will open a new page, there on the left-hand panel click on Security

image

Then click on Create and Manage API Tokens

image

Click on Create API token button and the create the token and save it somewhere because you will not be able to see it again anywhere if you don’t have a copy

image

This is it. :smiley:

Connect Jira Software Application Scope –

Click on Jira Application Scope Software go to properties and fill API Token, Server Url(Copy Jira URL till the .com) and UserName you are using that is it you are now connected to Jira Software through UiPath and you are ready to perform operations now.

11_UiPath_Jira_Authentication

Can’t wait to perform operations now, right? Here you go then :blush:

  1. Create/Update/Delete Issue
    Create Issue – you can use an activity like below, Issue Type you can provide like Bug, Epic, Task, etc.

image

Once you run this activity, see your Jira application, it should create a new issue –

image

Update Issue –

For updating an issue, you will have to use update issue activity and pass issue ID which is available in Jira and then you can update multiple fields in a single go.

Delete Issue –
For deleting an issue you can simply pass the Issue ID in Delete Issue activity nothing else is required.

  1. Assign Issue and Update Priority
    To update the priority, you just have to provide IssueID and Priority like Low, Medium, High etc.

Assign Issue
To assign an issue you will have to provide an account ID and Issue ID
You can use Execute method and pass the above information.

Issue ID you can get from the website, Account ID is nothing, but it is unique across all the Atlassian products, so to find it you can go to the profile page when you are on the profile page and click people.

image

When you click on someone’s profile at that time from the URL you will be able to find the account ID.

https://yourinstanceofJira.atlassian.net/jira/people/”This would be account ID”

If you do not get Assignee account ID, you can use find users where you can search from Name or email and then get the account id

image

Update Priority –

Just like we updated the summary, here also use get the issue and update the priority.

  1. Download/Upload Attachments

Upload Attachment –

You can simply provide the issue id and path of the file you want to attach, that is it

18_UiPath_Add_Attachment_Activity

Download Attachments –

Use get issue attachments activity, by just providing the issue id it will return an array of attachments which of type UiPath.JiraSoftware.Models.Attachment then you can iterate on this array variable and download all the attachments.

19_UiPath_Download_Attachment_Activity

  1. Add/Delete comments

Add a comment- For adding a comment you just have to provide Issue ID and your comment as a string.

Delete comment – For deleting a comment you should provide Issue ID and Comment as well. You can use get comments which will return you all the comments of that issue and then you can delete the comment you want.

20_UiPath_Add-Delete_Comment_Activity

You can also create filters, projects, get data from dashboards, create/delete issue links, and many more things you can play with, so go ahead and try everything.
So, what do you think guys, it is quite simple, right? It is indeed simple. I have done many projects where we are closing a huge number of tickets in minutes with proper commenting, another use case is we are downloading attachments like an excel file then performing some operations on the data and attaching the updated file. You can also create custom reports by tweaking the data from given activities. It is very useful for developers, clients everyone. So, give it a try, and if at any point you have any questions you can connect with me and I will help you for sure. :blush:

This is it, for now, will come back with more content.

Happy Automation! :blush:

-Prankur

4 Likes

Thanks for this. Very Helpful. I use Jira on a daily for backlog management and was excited to learn about UiPath’s Integration, so that I can create Backlog bot POC. :slight_smile:
One note on the setup steps (v2021.2.0). I did run into a Secure String error initially when c/p API Token directly in Studio. So I had to make the following adjustments to connect:

  1. Created an asset in Orchestrator of type “credential”
  2. Username = email address; Password = API Token
  3. In Studio, added the Get Credential activity (before the Jira Scope). Entered value of AssetName surrounded by quotes (e.g. “jiraAPI”)
  4. Added Jira Scope and under Token Authentication parameters, created variable named password to pass in the API Token and variable username to pass in email set within the orchestrator Asset.
1 Like

Yes right, we have to tweak some code when using that package. Jira integration is indeed very useful.

@PrankurJoshi - Thanks for sharing details in this tutorial.

How can we validate Output Result for ‘Add Comments to Issue’ activity? Bot is actually able to add internal comments to issue but out_Status is showing null status after comments added to issue.

We have to make sure comments are always added by Bot so Output Result is always important to validate.

Hello @Sonalk

Can you please let me know what Studio version you are using?

The minimum Studio version is 20.4 for Jira activities and the latest package version is 2.2.0

Thanks,
Prankur

@PrankurJoshi : Thanks. I’ve updated the package version to v2.2.0.

I am now getting this result in out_Status. Which field do you normally use for validation (out_Status.xxx)?

image

1 Like

Yes, it returns Atlassian.Jira.Comment type of a variable from that you can choose Body if the body is same as what you commented then its correct. You can also use Author property which is nothing but the emailID of the person who commented.

Thanks @PrankurJoshi. Let me try and explore this method.

1 Like

Hi @PrankurJoshi ,

I was able to create the ticket but when i try to add comment to it its throwing an error . please assist me on this .

Regards,
Akhil B

Hello @Bachali

How are you?

Can you please show me which activity you are using?

Thanks,
Prankur

Hi @PrankurJoshi ,
I’m Good Thank you

please find the attached screenshots of activity and package

image

Regards
Akhil B

Can you provide me full workflow?

if not here you can DM me

Hi @PrankurJoshi

i have sent you xaml file.

Thanks for your support.

Regards,
Akhil B

1 Like