Jira (Beta)
Jira is an issue and project tracking tool that teams use to plan, track, and resolve work. The Sauce Labs integration with Jira lets you create Jira tickets directly from your Sauce Labs test results, so you can log a defect where you find it without copying details between tools.
Each ticket includes the test context you choose and a link back to the result in Sauce Labs, and stays linked to the test result, so you can see which tickets were already created for it.
To create Jira issues from production errors and crashes instead of test results, see Jira Integration with Error Reporting.
How It Works
An organization admin connects your Jira Cloud site to your Sauce Labs organization by authorizing Sauce Labs with Atlassian. After the site is connected, you can create Jira tickets manually from the following places in Sauce Labs:
- Automated > Test Results
- Automated > Test Details
- Automated > Builds > Build Details
- Visual > Builds > Build Details, in the snapshot review
When you create a ticket, you choose the Jira project and issue type, edit the ticket summary and description, and select the test details and attachments to include, such as screenshots, the video, and logs. Sauce Labs creates the ticket in Jira and links it to the test result. A Jira icon with the number of linked tickets appears on the test result, and you can open the list of linked tickets and their details without leaving Sauce Labs.
You can use the integration to:
- Create a Jira ticket for a failed test from the place where you find the failure.
- Include only the test context that matters, such as the test name, job ID, status, OS, and browser.
- Attach screenshots, the video, and logs from the test to the ticket.
- See the Jira tickets already created for a test result, and their status, before you create another one.
Prerequisites
Before you begin, make sure you have:
- A Jira Cloud site.
- A Sauce Labs account with access to the Integrations page. Only an organization admin can connect or disconnect a Jira site.
- An Atlassian account for the organization admin who connects the site, with permission to create issues in the Jira projects where you want to create tickets. Sauce Labs creates every ticket with this account.
Authentication and Permissions
The Jira integration uses Atlassian's app authorization instead of an API key or token. When you connect a Jira site, Atlassian asks you to choose the site and to authorize Sauce Labs to access it on your behalf. Atlassian lists the permissions that Sauce Labs requests before you accept.
Sauce Labs creates every ticket with the Atlassian account of the organization admin who connected the site. Other users don't sign in to Atlassian to create tickets, so the connecting account needs permission to create issues in each Jira project you want to use.
Sauce Labs requests the following permissions:
| Type | Permissions |
|---|---|
| Read | read:project:jira, read:project.property:jira, read:project.component:jira, read:project-category:jira, read:project-version:jira, read:issue-type:jira, read:issue-type-hierarchy:jira, read:issue-meta:jira, read:field:jira, read:field.default-value:jira, read:field.option:jira, read:field-configuration:jira, read:status:jira, read:issue-status:jira, read:issue.transition:jira, read:issue:jira, read:issue-details:jira, read:issue-security-level:jira, read:issue.changelog:jira, read:issue.vote:jira, read:attachment:jira, read:user:jira, read:application-role:jira, read:group:jira, read:avatar:jira |
| Write | write:issue:jira, write:issue.property:jira, write:attachment:jira, write:comment:jira, write:comment.property:jira |
| Other | offline_access, which keeps the connection active without signing in again. |
To revoke access, disconnect the Jira site in Sauce Labs.
Set Up the Integration
An organization admin connects the Jira Cloud site once for the whole organization.
Connect Your Jira Cloud Site
Step 1: Inside your Sauce Labs account, click on your profile icon in the top-right corner, and then select Integrations from the dropdown list.
Step 2: Find Integrate with Jira and click on Configure. The Jira Configuration page opens.
Step 3: Click Connect Jira. This starts the process of connecting your Jira Cloud site to Sauce Labs.
Step 4: Log in to your Atlassian account. Then select the Jira Cloud site you want to connect, review the permissions that Sauce Labs requests, and select Accept.
Step 5: After authorization is complete, you are redirected to the Jira Configuration page. The Jira site appears under Connected Sites with the Connected status.
Verify the Integration
After setup, confirm the integration from both sides:
- In Sauce Labs: On the Jira Configuration page, the Jira site appears under Connected Sites with the Connected status. If it does not, see Connect Your Jira Cloud Site.
- In Jira: Create a test ticket from a test result, as described in Create a Jira Ticket, and check that it appears in the Jira project you selected.
If either check fails, see Troubleshooting.
Create a Jira Ticket
You create a Jira ticket from the Create Jira Ticket dialog. You can open the dialog from the Test Results, Test Details, and Build Details pages, and from the snapshot review in Visual Testing. The dialog works the same way everywhere. The test details and attachments it offers depend on the test.
From the Test Results Page
Step 1: In Sauce Labs, click Automated, and then click Test Results.
Step 2: Find the test result you want to create a ticket for, and then select the ⋮ (More options) menu at the end of its row.
Step 3: Select Create JIRA Ticket.
Step 4: Complete the Create Jira Ticket dialog. See Fill In the Create Jira Ticket Dialog.
From the Test Details Page
Step 1: Open the Test Details page for the test result you want to create a ticket for.
Step 2: Click the Jira icon below the test name. The Jira Tickets drawer opens and lists the tickets already linked to the test.
Step 3: Select Create Jira Ticket.
Step 4: Complete the Create Jira Ticket dialog. See Fill In the Create Jira Ticket Dialog.
From the Build Details Page
Create a ticket from a build to report a problem with the build as a whole, such as several failed tests.
Step 1: In Sauce Labs, click Automated, click Builds, and then click the build you want to create a ticket for.
Step 2: On the Build Details page, select the ⋯ (More options) menu in the upper-right corner, and then select Create JIRA Ticket.
Step 3: Complete the Create Jira Ticket dialog. See Fill In the Create Jira Ticket Dialog.
From the Visual Snapshot Review
Create a ticket from a visual snapshot to report a visual change that is a defect.
Step 1: In Sauce Labs, click Visual Testing, and then click Builds.
Step 2: Click the build that contains the snapshot you want to report.
Step 3: Open the snapshot you want to report. The snapshot review opens and shows the baseline and the current snapshot.
Step 4: Select the ⋯ (More options) menu in the upper-right corner, and then select Create Jira Ticket.
The Create Jira Ticket option appears only when both the snapshot and its baseline are available. For example, it does not appear for a new snapshot that doesn't have a baseline yet.
Step 5: Complete the Create Jira Ticket dialog. See Fill In the Create Jira Ticket Dialog.
Fill In the Create Jira Ticket Dialog
The Create Jira Ticket dialog shows the connected Jira site next to Workspace, and the test the ticket will be linked to under Linked test. If more than one Jira site is connected, the dialog also shows a Jira Site list above Project. Select the site where you want to create the ticket first.
Step 1: In Project, search for and select the Jira project where you want to create the ticket. The rest of the fields appear after you select a project.
Step 2: Complete the ticket fields described in the following table. The fields available after Project depend on the configuration of the selected Jira project.
| Ref. | Field | Description |
|---|---|---|
| 1 | Project | The Jira project where the ticket is created. Search by project name or key. |
| 2 | Issue Type | The Jira issue type of the ticket, for example, Bug. |
| 3 | Summary | The title of the ticket in Jira. Sauce Labs fills it in from the test result, and you can edit it. |
| 4 | Status | The Jira status to move the ticket to, for example, In Progress. Jira always creates the ticket in the first status of its workflow, and Sauce Labs then moves it to the status you select. If the Jira workflow doesn't allow that move, the ticket stays in its first status, and a warning tells you so. |
| 5 | Priority | The Jira priority of the ticket, for example, Major. |
| 6 | Include in Description | The test details to add to the ticket description: Test name, Job ID, Status, OS, and Browser. Select or clear each detail. You can also edit the description text directly. |
| 7 | Assignee | The Jira user the ticket is assigned to. Search by name. |
| 8 | Tags | (Optional) Labels to add to the ticket. Separate multiple tags with commas, for example, cypress, e2e, failed-test. |
| 9 | Attachments | The files from the test to attach to the ticket, such as screenshots, the video, the browser console log, the job configuration, the test report, and the Sauce Labs job log. The video is uploaded as a file, video.mp4. Files larger than 25 MB aren't attached. The available files depend on the test. |
| 10 | Linked test | The test result that the ticket is linked to, with its status. Select Linked tickets to view the tickets already linked to the test. |
Step 3: After you complete the fields and select the attachments, click Create Ticket.
Result: Sauce Labs creates the ticket in Jira and uploads the selected attachments to it. While the files upload, the button shows Attaching assets. When the upload is complete, Sauce Labs shows the Ticket created successfully message, with a link to open the ticket in Jira. If a file can't be attached, a warning lists the file and the reason. The ticket is linked to the test result, and the number next to the Jira icon on the test result increases by one.
View Linked Jira Tickets
Every ticket you create from Sauce Labs stays linked to its test result. A Jira icon with the number of linked tickets appears on the test result on the Test Results, Test Details, and Build Details pages, and in the visual snapshot review. Hover over the icon to see the number of tickets. Check the linked tickets before you create a new one to avoid duplicates.
Step 1: Open the linked tickets in one of the following ways:
- On the Test Details or Build Details page, click the Jira icon.
- In the visual snapshot review, select the ⋯ (More options) menu, and then select View Existing Jira Tickets.
- In the Create Jira Ticket dialog, select Linked tickets under Linked test.
The Jira Tickets drawer opens and lists the tickets linked to the test. Each ticket card shows the ticket key, Jira status, priority, summary, assignee, and creation date.
Step 2: (Optional) Use the Search by title or assignee field to find a ticket. To get the latest status of the tickets from Jira, select the Refresh icon.
Step 3: Select a ticket card to view the ticket details, including the issue type, reporter, project, tags, and description. To open the ticket in Jira, select the ticket key.
Manage the Integration
Disconnect a Jira Site
Disconnect the Jira site when you no longer want to create Jira tickets from Sauce Labs. Only an organization admin can disconnect a Jira site.
Step 1: On the Integrations page, find Integrate with Jira and click on Configure.
Step 2: Under Connected Sites, click Disconnect next to the Jira site.
Result: The Jira site is disconnected from Sauce Labs. If no other Jira site is connected, the Create Jira Ticket option is disabled, with the hint Connect a Jira site under Integrations. Tickets that were already created stay in Jira.
Troubleshooting
If the Jira integration does not work as expected, use the following solutions to resolve common issues.
You cannot connect a Jira site
The Create Jira Ticket option is disabled
You can't create a ticket in a Jira project
An attachment is missing from the ticket
The ticket status in Sauce Labs is out of date
Next Steps
- Learn how to read your results in Viewing Test Results.
- Learn what each status means in Test Status.
- Send test results to Slack with the Slack integration.
- Create Jira issues from production errors and crashes with Jira Integration with Error Reporting.