> For the complete documentation index, see [llms.txt](https://learning.contextqa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learning.contextqa.com/integrations/jira.md).

# Jira

{% hint style="info" %}
**Who is this for?** SDETs, developers, and engineering managers who want to generate tests from Jira tickets and report defects directly from ContextQA test failures.
{% endhint %}

The ContextQA Jira integration creates a two-way connection between your requirements and your test suite. You can generate test cases directly from a Jira user story, view live execution status inside Jira, and report defects as Jira issues without leaving the test result page.

[Watch the Jira-to-tests walkthrough](https://drive.google.com/file/d/1v3KHLYP17reGp1BZDSOOxGF5MAsLuTF_/preview).

{% hint style="info" %}
**Business use case:** Generate tests from the Jira stories selected for a release so QA can preserve source traceability, review the proposed coverage, and run accepted tests without copying ticket content into a separate document.
{% endhint %}

![ContextQA Bug Reporting integration category showing Jira, Slack, Linear, Freshrelease, YouTrack, Mantis, Backlog, Zepel, and Bugzilla cards](/files/p1W47voHLmyk3biffJpa)

***

## Set up the Jira integration

1. Open **Integrations & Plugins** in the left navigation.
2. Find Jira in **All Plugins** or **Bug Reporting** and select **View Details**.
3. Open **Config** when you need to create or change the connection.
4. Enter the Jira **Account URL**, such as `https://yourorg.atlassian.net`.
5. Enter the Jira account **User Name** (normally the email address used for Jira Cloud).
6. Create a Jira API token at [Atlassian account security](https://id.atlassian.com/manage-profile/security/api-tokens), then enter it as the **API Key**.
7. Save the integration and confirm that its Jira details are displayed.

{% hint style="warning" %}
Treat the Jira API token as a secret. Never include it in screenshots, examples, ticket descriptions, or test steps.
{% endhint %}

***

## Generating Tests from Jira Tickets

1. Open **Requirements**.
2. Select **Upload Jira Requirement**.
3. Continue to the Jira ticket picker.
4. Search by ticket key or text and select one or more tickets that belong to the same testing objective.
5. Continue and review the detected variables. Mark sensitive values as secrets where appropriate.
6. Answer any clarification questions required to remove ambiguity from the selected stories.
7. Start generation and leave the requirements page open or return later while ContextQA processes the selection.
8. Open the generated requirement record and review each proposed test. Edit it if needed, then accept or reject it.
9. Run an accepted test once and review its steps and evidence before promoting it to a shared suite or plan.

The selected Jira item remains the source requirement, which makes it easier to explain why the test exists and which delivery item it covers.

***

## Running Tests from Jira

With test cases linked to a Jira ticket, you can trigger execution from the ContextQA panel inside Jira:

1. Open the Jira ticket
2. In the ContextQA panel, find the linked test cases
3. Click **Execute** next to the test case you want to run, or **Execute All** to run all linked tests
4. The panel updates with a status indicator (Running → Passed / Failed) as the execution progresses

You can also run tests from ContextQA directly and the results will be visible in the Jira panel the next time you open the ticket.

***

## Auto-Creating Defects from Test Failures

When a test case fails and the failure indicates a genuine application bug, ContextQA can create a Jira issue automatically with all relevant evidence attached.

### Via the UI

1. Open the failed test execution report in ContextQA
2. Click the **Create Bug** button (or **JIRA** button in the failure reporting toolbar)
3. Select the Jira project and issue type (Bug is the default)
4. Optionally customize the summary and description
5. Click **Create Issue**

ContextQA creates the Jira issue and populates it with:

* **Summary:** Derived from the test case name and the failing step
* **Description:** AI-generated root cause explanation, reproduction steps, and the exact step that failed
* **Attachment:** The failure screenshot
* **Links:** A direct URL to the ContextQA execution (for video, trace, and full step log access)
* **Labels:** The test case label (Jira ticket ID) for traceability

A link to the newly created issue appears immediately in the ContextQA execution report.

### Automatic bug creation and sync status

When automatic Jira bug creation is enabled, ContextQA creates a Jira issue automatically when a test run fails. The status of this auto-creation is visible directly on the execution screens:

**Auto-created bug badge:** When ContextQA successfully creates a Jira issue for a failed run, a clickable badge appears in the execution header displaying the Jira issue key (e.g., `MYAPP-1234`). Click the badge to open the issue directly in Jira.

**Sync status banner:** If the automatic bug creation fails (for example, due to invalid field values or permission issues), a warning banner appears at the bottom of the live execution screen and the run results screen. The banner displays the specific error reason (e.g., "labels: The label 'AI Upload' can't contain spaces.") and a **Retry** button. Click **Retry** to attempt the Jira issue creation again. The banner disappears when the sync succeeds or when the issue is created manually.

{% hint style="info" %}
The sync status banner only appears when the auto-creation pipeline fails. It does not appear for successful syncs, pending syncs, or legacy runs that predate this feature.
{% endhint %}

### Via MCP

```python
create_defect_ticket(
    execution_id="27045",
    project_id="MYAPP"
)
# Returns: {"ticket_id": "MYAPP-1234", "url": "https://yourorg.atlassian.net/browse/MYAPP-1234"}
```

This is the recommended approach for automated triage pipelines. Combine it with `get_execution_status` and `get_root_cause` to build a workflow that creates a Jira bug only when a failure persists across multiple runs:

```python
# Run the test
execution = execute_test_case(test_case_id="1234")
status = poll_until_complete(execution)

if status["result"] == "FAILED":
    # Get AI root cause before creating the ticket
    root_cause = get_root_cause(execution_id=status["execution_id"])

    # Create the defect ticket
    ticket = create_defect_ticket(
        execution_id=status["execution_id"],
        project_id="MYAPP"
    )
    print(f"Defect created: {ticket['url']}")
```

***

## Viewing Test Coverage in Jira

The ContextQA panel in Jira shows a summary of test coverage for each ticket:

* **Test Cases Linked:** How many test cases have been generated for or linked to this ticket
* **Last Execution Status:** The most recent execution result for each linked test case
* **Coverage Percentage:** What fraction of the acceptance criteria have corresponding test cases

This view gives product managers and developers visibility into test health without leaving their workflow in Jira.

***

## Bidirectional Status Sync

When you configure the integration with write access to Jira:

* When all test cases for a Jira ticket pass, ContextQA can automatically transition the ticket to a configured status (e.g., **Ready for Release** or **Done**)
* When a test case fails, ContextQA can reopen the linked ticket or add a comment with the failure details
* These automations are configured in **Settings → Plugins → Bug Reporting → Jira**

***

## Filtering Tests by Jira Ticket

In the ContextQA **Test Cases** view, use the **Labels** filter to display only test cases linked to a specific Jira ticket. Labels are applied automatically during generation and follow the Jira ticket number format (e.g., `MYAPP-123`).

***

## Using the Azure DevOps Integration

If your team uses Azure DevOps (ADO) instead of Jira, the integration follows the same patterns. Navigate to **Settings → Plugins → Bug Reporting → Azure DevOps** and configure your ADO organization URL and personal access token. The `create_defect_ticket` MCP tool supports ADO by setting the `tracker` parameter accordingly.

See the [Azure DevOps Integration](/integrations/azure-devops.md) page for full ADO-specific configuration details.

***

## Troubleshooting

**"Cannot connect to Jira" error during setup:**

* Verify the base URL does not have a trailing slash
* For Jira Cloud, the URL format is `https://yourorg.atlassian.net` (not `.com`)
* Confirm the API token is for the same account as the email address entered
* If you are on Jira Server, ensure the ContextQA server can reach the Jira URL (firewall/VPN)

**Test cases not appearing in the Jira panel:**

* Ensure the ticket ID format matches exactly (case-sensitive: `MYAPP-123` not `myapp-123`)
* Confirm the integration is configured from both sides (ContextQA settings and Jira panel installation)

**Defect tickets missing screenshots:**

* Screenshots are attached as links, not as uploaded files, due to Jira attachment size limits
* Click the ContextQA execution link in the Jira issue description to view full screenshots and video

{% hint style="info" %}
**Connect ContextQA to your CI/CD pipeline in 15 minutes.** [**Book a Demo →**](https://contextqa.com/book-a-demo/) — See the full integration walkthrough for your existing toolchain.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learning.contextqa.com/integrations/jira.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
