Test Automation for Jira with Katalon Studio

We have come up with this tutorial to guide you on test automation for JIRA with Katalon Studio.

Before we start talking about JIRA integration, we will have a quick overview of both the tools – Katalon Studio as well as JIRA.

Katalon Studio – Overview

Katalon Studio is a simple, powerful and a completely free automation solution for the web, Android, iOS and API testing on Windows and macOS.

It is simple to use, with cross-platform support and built-in JIRA integration. You can setup projects, create tests, run tests, view reports and maintain tests very easily using Katalon Studio.

What You Will Learn:

Jira Integration with Katalon Studio

(Note: Click on any image for enlarged view)

Katalon Studio’s main features

Visit Katalon Studio website here.

To explore more on Katalon Studio you may refer below STH posts:

JIRA – Overview

As most of us already know, JIRA is one of the best tools to plan, track and release great software. It is widely used by agile teams.

We won’t go into much detailed talk here about JIRA itself. We are rather interested to learn about Katalon integration with JIRA. If you want to read in depth about JIRA, you can refer to STH JIRA Tutorials.

Katalon Studio offers a JIRA add-on. Let us move ahead and see how we can install and use Katalon’s JIRA add-on.

Benefits of JIRA add-on

The free JIRA add-on helps to create a seamless integration. The major benefits of JIRA add-on are:

Installation of Katalon’s JIRA add-on

Click here to get the Katalon BDD- Test automation for JIRA add-on. Currently, only JIRA server is supported.

You can follow the below steps for installation:

Gherkin Custom Field

As we discussed above, upon finishing the installation, you will find that a custom field type called Katalon Gherkin is added to your JIRA instance.  It will allow you to write the test cases’ description and stories in Gherkin syntax.

The Gherkin keywords like ‘Then’, ‘When’, ‘Given’ will be highlighted automatically. Once the issue is imported to Katalon Studio, the content of the Gherkin custom filed from JIRA will be populated into the Katalon test case description.

Follow these steps to add the Gherkin Custom field:

1) Choose ‘Issues’.

2) Select Fields -> Custom Fields and Click ‘Add Custom Field’.

3) Select ‘Advanced’. You will get below screen:

4) Select ‘Katalon Gherkin’ and click on next.

5) Configure the field.

6) Click on Create button.

7) Click on ‘Submit’ button to finish adding the Gherkin custom field.

The below screenshot shows an example of how the Katalon Gherkin custom field appears in the JIRA issue:

Refer below link to learn more about adding and configuring custom fields in JIRA:

Katalon Studio – JIRA Integration: Configuration Steps

1) In Katalon Studio, go to Project -> Settings -> Integration -> JIRA

2) Check Enable Integration Option. The settings will be available for configuration.

3) Specify the server URL, username, and password. Click on connect button.

4) After establishing a successful connection with JIRA, all relevant JIRA projects and issue types will be displayed under submit options. You can select the default JIRA project and issue type for submission here.



Below are the details of submitting options:

FieldDescription
Default JIRA ProjectThe default JIRA project to submit a ticket.
Default JIRA Issue TypeThe default JIRA Issue type to create when submitting a ticket.
Use Test Case name as Summary for JIRA ticketThe Katalon Test Case Name will be used as a summary for the submitted ticket.
Attach Screenshot to JIRA ticketAny taken screenshot during execution will be included in submitted ticket.
Attach Log to JIRA ticketThe execution log will be included in the submitted ticket.

In the latest Katalon version (4.7), we also have a submit option – ‘Automatically submit test result’.  Selecting this option will submit the Katalon test execution result automatically to the linked JIRA ticket.

5) Once you have selected the submit options, click on ‘Apply’ and then ‘OK’ button to complete the JIRA integration setup.

Create Test Cases in Katalon Studio from JIRA Issues

Once the JIRA integration setup is done, JIRA icon will be available on Katalon Studio menu bar.

Follow the steps below to sync Test Cases from JIRA to Katalon Studio:

1) From JIRA, prepare the JIRA JQL script.

JQL is JIRA Query Language used in the advanced search.

For example, if you want to see sorted search results, you can use ORDER BY clause in JQL query. JQL is not a database query language. However, it is the SQL-like syntax.

A sample JQL is shown in below screenshot.

2) Now click on JIRA icon from the Katalon Studio menu bar.

3) Upon clicking the JIRA icon, import JIRA dialog will be displayed.

4) Enter the JIRA JQL we prepared in step 1 in the dialog.

Click on ‘OK’ Button. Based on your JQL, Katalon Studio will sync all the JIRA test cases.

5) Once you click on ‘OK’ in step 4, you will be asked to choose the destination for new issues. Here you can mention the location for syncing JIRA test cases. You can either specify the location manually or Katalon will automatically generate a default location.

Choose a destination and click ‘OK’.

6) The syncing process now done and now you can go to ‘Tests Explorer’ of Katalon Studio to check if the JIRA test cases have been synced properly.

Submit Katalon execution results & logs to JIRA issues

Katalon Studio test execution results are automatically synced with the associated JIRA issues. Right inside JIRA, you can review the status and attachments (logs) of Katalon Studio test cases under the ‘Katalon Execution Result’ section as highlighted in below screenshot, showing that the status is ‘Passed’ and the execution log is included in Attachments.

Submit Bugs to JIRA from Katalon Studio

Submit options will be available in Katalon Test Reports after JIRA Integration setup is done.

Follow below steps to submit Bugs in JIRA from Katalon Studio:

1) In Reports, open a test execution that you want to review for issues. In the below screenshot, you can see that a dedicated column for JIRA integration is enabled in Test cases table. Corresponding to each failed test case, it says ‘Click to Manage JIRA issues’.

2) Click on the JIRA bug icon (as shown above). Upon clicking, you will be displayed a list of linked JIRA issues corresponding to the Test Case.

No JIRA issue is currently linked with this Test Case.  Now, we will add and submit an issue to JIRA.

3) Go to ‘Add’ and select ‘Create as New’.

We have 3 submitting options – ‘Create as New’, ‘Create as sub issue’ and ‘Link to Existing Issue’. Let’s have a brief description of each of these options:

Create as New:

In this case, a new issue will be submitted to JIRA.

Create as sub issue:

Here, a sub task of an existing JIRA issue will be created. You will be asked to enter the Parent JIRA issue ID for submitting sub task.

Link to Existing Issue:

Selecting this option will append the test case execution details to an existing JIRA issue.

You will be asked to enter the existing JIRA issue ID for linking.

4) As we have selected ‘Create as New’ option in step 3, we will be displayed a JIRA native submission form. See below screen shot as an example:

Based on your preferences in JIRA integration settings, the summary, screenshot, and logs will be populated automatically in the above screen.

5) After ensuring that all the necessary details are filled, click on the ‘Create’ button present at the bottom of the form.

6) You will be displayed the newly created Jira issue under the Linked JIRA issues section. You can see the ID, summary, and status of the issue. Clicking on the ID will directly take you to the JIRA issue.

View Katalon Studio Test Execution result through JQL

Using, JQL syntax, Katalon Studio test execution result can be queried from JIRA.  The syntax is as below:

“Katalon Status”=<status>

Where the status value can be ‘PASSED’ (the automation tests have been executed successfully), FAILED (the automation tests have been failed at certain steps), INCOMPLETE (the automation tests where one or more steps have got left unexecuted), ERROR( the automation tests in which some errors occurred).

For example, to view all test cases that have ‘ERROR’ in Katalon, you can use the highlighted JQL below in JIRA search:

Conclusion

Hope this tutorial was helpful for you to learn the integration of Jira with Katalon Studio. The tutorial explains in detail how to submit Jira bugs automatically with information generated by Katalon Studio.

You try this by downloading the Katalon Studio for free from here.

Let us know if you have any queries.