- Overview
- Key Features
- Repository Structure
- Prerequisites
- Setup Instructions
- Placeholder Variables
- Example Workflow
- Troubleshooting
- Related Resources
- Contributing
- License
This repository demonstrates a Proof of Concept (POC) for integrating Postman with Jira to automate the posting of test results as comments on Jira tickets. This integration reduces manual effort and improves team efficiency by consolidating test results and directly adding them to the relevant Jira tickets.
- Automated Comments: Consolidates test results and formats them as Jira comments.
- Detailed Request/Response Information: Includes Request Method, URI, Payload, Query Params, Status Code, and Response Body in the comments.
- Rich Text Formatting: Headings, bold text, and JSON-formatted response bodies for readability.
- Duplicate Removal: Ensures no test scenarios are repeated in comments.
- Extensible:
- Easily customizable to add more test cases or scenarios.
- Supports adding additional automation workflows for Jira tasks.
postman-jira-automation/
├── assets/ # Contains static assets (e.g., images, screenshots)
│ └── example-jira-comment.png # Example of a Jira comment for the workflow
├── postman/ # Postman collection and environment configuration
│ ├── collection.json # Postman collection
│ ├── environment.json # Postman environment variables with placeholders
├── scripts/ # Pre-request and test scripts for Postman
│ ├── collection_pre_request.js # Clears variables before running the collection
│ ├── final_request_pre_request.js # Posts consolidated test results to Jira
│ └── request_test_script.js # Captures test results dynamically
├── LICENSE # License file for the project
└── README.md # Project documentation
Before you begin, ensure you have the following:
- Postman installed (Download here).
- A Jira account with API access.
- A Jira API Token (Generate it here).
- Basic knowledge of Postman collections.
Clone the repository to your local machine:
git clone https://github.com/ashikkumar23/postman-jira-automation.git
cd postman-jira-automation
-
Import the Postman Collection:
- Open Postman and import the
collection.json
file from thepostman/
directory.
- Open Postman and import the
-
Import the Postman Environment:
- Open Postman and import the
environment.json
file from thepostman/
directory.
- Open Postman and import the
-
Update the Environment Variables:
- Replace placeholders (e.g.,
{{replace_with_your_encoded_jira_auth_token}}
) with appropriate values.
- Replace placeholders (e.g.,
-
Verify All Variables:
- Ensure placeholders are replaced with the correct values before running the collection.
- Open the Postman Collection Runner.
- Select the imported collection and the environment you configured.
- Click Run to execute the requests.
Variable | Scope | Description | Example | Default Value |
---|---|---|---|---|
baseUrl |
Collection | Base URL of the API being tested | https://jsonplaceholder.typicode.com |
None |
testResults |
Collection | Stores test results dynamically during the run | [] |
[] |
jiraBaseUrl |
Environment | Jira instance URL | https://your-domain.atlassian.net |
Must be configured |
jiraAuth |
Environment | Jira API token encoded in Base64 | Basic dXNlcm5hbWU6YXBpdG9rZW4= |
Must be configured |
jiraIssueKey |
Environment | Jira issue key where test results will be posted | JGI-3 |
Must be configured |
Below is an example of how a consolidated test report appears as a Jira comment after running the Postman collection:
-
"INVALID_INPUT" Error:
- Ensure the Jira payload follows the strict
doc
format. - Check the Postman Console for debugging logs.
- Ensure the Jira payload follows the strict
-
Empty
testResults
Variable:- Confirm the
collection_pre_request.js
script runs only at the start of the collection.
- Confirm the
-
Authorization Errors:
- Verify the
jiraAuth
variable contains the correct Base64-encoded token.
- Verify the
-
Environment Variables Not Resolving:
- Ensure the correct environment is selected in Postman before running the collection.
- Use the Postman Console to debug issues (available under View → Show Postman Console).
- Ensure your Jira API token has the necessary permissions to post comments.
Feel free to open issues or submit pull requests to enhance this POC. Suggestions for additional features or bug fixes are welcome!
This project is licensed under the MIT License.