How to create Issue using Jira REST APIs with Postman
- Thilagavathi Amulraj
- Jan 10
- 6 min read
Jira is a project management tool used across Agile teams where we can create Epics, Stories, tasks, sub-tasks, and Issues. This is the platform where you can collaborate with different team members like Product Owners, Business Analysts, Developers, Data Analysts, and DevOps teams and check for the progress made.
As a QA, we usually execute hundreds of test cases through automation. Let's say 5 test cases fail. Typically, what we do is open Jira and create an Issue manually for all the failed test cases, and it will take around 30 to 45 minutes of time to do.
Instead of opening the Jira UI and creating an issue every time manually, we can do this using REST API calls with Postman. We can import the Jira API into Postman, which is a one-time activity, and send the required input as a request payload using the POST method. Postman will create an issue for you and return the Issue ID as a response payload. We can take the Issue ID and just verify the same using the GET method or Jira UI.
Steps to create a project in Jira
You can get your free Jira account from the Atlassian official website: https://www.atlassian.com/software/jira
Go to the website and click on Get It Free.
You can enter your work email or you can sign up with Google authentication.
When you create an account, every person gets their own website hosted on the Jira cloud for free.
On the next page, select the Software Development option for the "What kind of work do you do?" question and click Continue.
On the next page, select the Scrum option (we select Scrum because in almost all Agile projects we use Scrum, which is a basic framework) for the "Where would you like to start?" question and click Continue. It creates a cloud URL for you within a few seconds.
Let's name your project (e.g., "My Automation Project") and click on Get Started. Now we have created one software project in Jira.
Lets create Issue in Jira
Under the created project, on the right-hand side of the search box, you can see the + Create option in blue.
Select work type as Bug
Enter the Summary and Description of the Bug.
Click on the Create button. Now you will see the work item number in the bottom left corner.
Click on the View link and verify the entered details.
This is our cloud URL: https://thilagavathiamulraj90.atlassian.net
Exploring Jira APIs
Go to Google.com and search "Jira Cloud API" and you will get their official website information. When you go to the Atlassian Developer Documentation, you can see how to work on all the APIs.
First, we need to understand how to authenticate with the Jira account that we created. We have created an account manually, but when we want to create a project or a bug via API, it needs to know which account to use. It must connect to the created account: https://thilagavathiamulraj90.atlassian.net.
To do this, we need to authenticate with Cloud Jira before calling the APIs. There are different ways to authenticate yourself. To keep it simple, go to the Jira REST API Introduction. On the left-hand side, look for Authorization and Authentication and click on it.
There are different types of authentication available like OAuth 2.0, Basic Auth, and so on. These are used to "unlock" APIs. Here we are using Basic Auth, so click on Basic Auth for REST APIs.
Setting up Authentication
Reference document link: https://developer.atlassian.com/cloud/jira/software/basic-auth-for-rest-apis/
The documentation says you need to supply Basic Authentication headers. This means when you make a POST call to create a bug, you need to send the authentication details in the headers.
Click on the Atlassian Account link and login to https://id.atlassian.com/manage-profile/security/api-tokens.

On the next page, Click on Create API Token

Enter the TokenName and click on Create, adjust the Expires on date according to your requirements.

Your API token will be generated. Copy and save it somewhere safe; you won't be able to see this token again. Click Done.
This is a secret key which will help you to authenticate yourself to jira. So make sure you copy it here and you wont be able to see this token again. Here we have created Basic Authentication Token

Encoding the Token
Atlassian recommends converting this token into BASE64 encoding for security. You need to follow these instructions to build a string in this format useremail:api_token. (note : The user email must be the address that you use to Log in to Jira and the API token should be the value that you copied in the previous step)
So, for security purpose when you are sending the token as a header for all your jira APIs, you need to send it in a Base64 encoding format. So, jira again internally decodes and retrieves the actual string.
Now we need to convert this string into Base64 encoding format
If you are a windows 7 user follow the below instructions in Powershell to get the converted base64 encoded format.
For $Text = 'user@example.com must be email address that you use to Log in to Jira and api_token_string must be the token value that you have created'

If you are a mac user use echo -n and give the entire string that we constructed in terminal like this.

Click on enter and this is your newly converted base64 encoded format. This is the header value you need to pass into your authentication header value in jira when calling any Jira API's.
When you pass this, it will make sure you are in right user and it will authenticates for you to the corresponding user account (sample@gmail.com)

To keep it simple, There are lot of online utilities also available to convert the string to base64 encoding format.
Understanding How to Create an Issue (POST Call) in Postman using API
Reference Document: Jira Cloud Create Issue API
On the right-hand side of the "Create Issue" documentation, you will find the API Contract which explains how to use the call.

1. Setting Up the URL
Select cURL from the available options in the documentation. You will see a URL structured like this: https://your-domain.atlassian.net/rest/api/3/issue
Before using this, replace your-domain with the actual domain you created earlier. For example, if your domain is "sample," your endpoint will be: https://sample.atlassian.net/rest/api/3/issue
2. Configuring Postman
In Postman, create a new Collection named "Jira API."
Add a new Request named "Post Bug."
Set the HTTP method to POST.
Paste your updated endpoint URL and click Save.

3. Updating the Headers
Now, we need to configure the Headers so the API knows what data we are sending and who we are:
Content-Type: Set to application/json.
Accept: (Usually added by default).
Authorization: Add a new key called Authorization. The value will be the word Basic followed by a space and your Base64 encoded string (e.g., Basic dGhpbGFnY...).
Now your API request knows how to authenticate itself with your Cloud Jira account.

4. Creating the Request Payload
Reference for Sample Payload: Jira REST API Examples

Copy the JSON input data from the link above and paste it into the Body tab in Postman (select raw and JSON). This payload tells Jira to create a bug with a specific summary and description.
Important: Ensure the project key in your JSON matches your project in Jira (e.g., TJA). You can find this key in your Jira Project Settings.
This simple payload will help you to create a bug with summary under the project key called TJA

Important: Ensure the project key in your JSON matches your project in Jira (e.g., TJA). You can find this key in your Jira Project Settings.

5. Sending the Request
Click Send. If successful, you should see a response code: 201 Created.

You can refer to the official documentation to understand other status codes and error messages.

6. Verifying in Jira
Copy the key value (e.g., TJA-123) from the response payload in Postman. Navigate to your Jira UI, paste that value into the search box, and hit Enter. You will see that the issue was successfully created through the REST API!

Like this, When you are working with automation and if test cases are failing you can take that test case name and integrate you Ui Automation with Rest Assured and you can create the bug dynamically
That's all!!!
Conclusion
In this blog, We have successfully explored how to create issue using the REST API through postman using simple payloads and validate the created issue in Jira UI using key value from response payload which is leading to efficient way to save the time.
Thank you
Happy Learning!!

