Jira Plugin
- Learn more about Allure Report at allurereport.org
- Documentation – Discover the official documentation for Allure Report
- Questions and Support – Get help from the team and community
- Official Announcements – Stay up to date with the latest updates
- General Discussion – Engage in casual conversations, share insights, and ideas with the community
Overview
This plugin allows you to send Allure reports to Jira.
Installation
Use your preferred package manager to install the package:
npm add @allurereport/plugin-jira
yarn add @allurereport/plugin-jira
pnpm add @allurereport/plugin-jira
Then, add the plugin to the Allure configuration file:
import { defineConfig } from "allure";
export default defineConfig({
name: "Allure Report",
output: "./allure-report",
historyPath: "./history.jsonl",
plugins: {
+ jira: {
+ options: {
+ webhook: "https://95f453e...",
+ token: "dmR2dWto...",
+ issue: "JIRA-123",
+ uploadReport: true,
+ uploadResults: true
+ },
+ },
},
});
Options
The plugin accepts the following options:
| Option | Description | Type | Environment Variable |
|---|---|---|---|
webhook |
Allure Jira Integration Webhook URL | string |
ALLURE_JIRA_WEBHOOK |
token |
Generated Atlassian API token | string |
ALLURE_JIRA_TOKEN |
issue |
Jira issue to link report to | string |
ALLURE_JIRA_ISSUE |
uploadReport |
Whether to upload the report to specified jira issue | boolean |
ALLURE_JIRA_UPLOAD_REPORT |
uploadResults |
Whether to upload the test results to linked issues | boolean |
ALLURE_JIRA_UPLOAD_RESULTS |
Note: Any values set in your allurerc.mjs configuration file will take precedence over values defined in environment variables.
Webhook URL
- Navigate to your app's "Get Started" page.
- Copy the webhook URL provided on that page.
Token
- Navigate to Atlassian Account > Security > API Tokens.
- Click the "Create API token with scopes" button.
- Enter a name for your token and set an expiration date.
- Select "Jira" as the API token application.
- Search for and enable the
read:jira-userscope. - Save the token and copy it to your clipboard.
- Create a string in the format
useremail:api_token, whereuseremailis your Jira account email andapi_tokenis the token you just created. Then, encode this string using BASE64.
- Linux/Unix/MacOS:
echo -n "user@example.com:api_token_string" | base64
- Windows 7 and later, using Microsoft Powershell:
$Text = "user@example.com:api_token_string" $Bytes = [System.Text.Encoding]::UTF8.GetBytes($Text) $EncodedText = [Convert]::ToBase64String($Bytes) $EncodedText
Access token is required to verify your permissions and to ensure you have edit access for the specified Jira issue(s). It is used only for this verification step and nothing else.
Usage
Uploading Test Results and/or Reports to Jira
When you set either the uploadReport or uploadResults flag to true, the plugin will automatically upload the Allure report or test results to Jira during the report generation process.
- Use
uploadReport: trueto attach the full report to a specific Jira issue. - Use
uploadResults: trueto upload individual test results linked to Jira issues.
Once report generation is finished, the specified data is seamlessly sent to your Jira instance—no extra commands required.
Note:
- The user associated with the provided token must have edit permissions for any Jira issues specified in the
issueoption, as well as for any issues linked in your tests. - Only issues belonging to the Jira instance specified by provided
webhookURL will be processed or updated by the plugin.
Clearing Uploaded Data
You can remove previously uploaded test data from Jira using the allure jira clear command. This allows you to clear reports, results, or both from one or multiple Jira issues.
Clear Uploaded Reports
Use the --reports flag to delete uploaded reports for the specified issue(s):
# Using npm
npx allure jira clear --token <token> --webhook <webhook-url> --issue <issue-key> --reports
# Using yarn
yarn allure jira clear --token <token> --webhook <webhook-url> --issue <issue-key> --reports
# Using pnpm
pnpm allure jira clear --token <token> --webhook <webhook-url> --issue <issue-key> --reports
You may specify multiple issues by repeating the --issue flag:
# Using npm
npx allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --reports
npx allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --issue JIRA-2 --reports
# Using yarn
yarn allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --reports
yarn allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --issue JIRA-2 --reports
# Using pnpm
pnpm allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --reports
pnpm allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --issue JIRA-2 --reports
Clear Uploaded Test Results
Use the --results flag to delete test results uploaded to one or more issues:
# Using npm
npx allure jira clear --token <token> --webhook <webhook-url> --issue <issue-key> --results
# Using yarn
yarn allure jira clear --token <token> --webhook <webhook-url> --issue <issue-key> --results
# Using pnpm
pnpm allure jira clear --token <token> --webhook <webhook-url> --issue <issue-key> --results
Examples:
# Using npm
npx allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --results
npx allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --issue JIRA-2 --results
# Using yarn
yarn allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --results
yarn allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --issue JIRA-2 --results
# Using pnpm
pnpm allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --results
pnpm allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --issue JIRA-2 --results
Clear Both Reports and Results
To remove both uploaded reports and test results from the specified issues, use both flags together:
# Using npm
npx allure jira clear --token <token> --webhook <webhook-url> --issue <issue-key> --results --reports
# Using yarn
yarn allure jira clear --token <token> --webhook <webhook-url> --issue <issue-key> --results --reports
# Using pnpm
pnpm allure jira clear --token <token> --webhook <webhook-url> --issue <issue-key> --results --reports
Examples:
# Using npm
npx allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --results --reports
npx allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --issue JIRA-2 --results --reports
# Using yarn
yarn allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --results --reports
yarn allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --issue JIRA-2 --results --reports
# Using pnpm
pnpm allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --results --reports
pnpm allure jira clear --token dmR2dWto... --webhook https://95f453e... --issue JIRA-1 --issue JIRA-2 --results --reports
Tip:
- You can use the
--issueflag multiple times in a single command to target several Jira issues at once. - Always provide a valid
--tokenfor authentication and correct--webhookfrom the app in your Jira instance. - Use the flags
--reports,--results, or both based on what you want to clear.