Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA REST API: Create Issues via API, required fields

Radu Pavelco
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 27, 2017

Hi, can somebody help me to find out how can I get a list of all required fields for creating an issue?

There's https://example.atlassian.net/rest/api/2/field API that returns a list of fields, but we can not see there what fields are required for a specific project, for example for a project, the "components" are required, for another - no?

 

Is there a possibility to check the required fields to create an issue?

Thank you!

2 answers

2 votes
Gareth Cantrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 17, 2017

There are some tutorials on the developer site which deal with exactly your question:

JIRA REST API Example - Create Issue 

and

JIRA REST API Example - Discovering meta-data for creating issues 

0 votes
Nikhen Sanjaya Nyo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 26, 2024

Hey there, I just wanted to share what helped for me just in case it could help anyone else:

To determine the required fields needed to create my jira issue from the POST method, I did the following:

 

First, I added this import to help with debugging: (in python)

 

import logging

logging.basicConfig(level=logging.DEBUG)
Then, upon running my code to create the jira issue, it would let me know in the Response text what fields I am missing/what fields I am adding that is in the wrong format:
Example:
DEBUG:atlassian.rest_client:HTTP: Response text -> {"errorMessages":[],"errors":{"issuetype":"Specify an issue type"}}


In this case it said I am missing an issue type, which after cross comparing to a manually created issue, I realised it was the field 'issuetype'. Through this, I iteratively fixed the issues one at a time until I had all of the relevant fields for the issue creation. This is just one way of doing it and probably not too efficient but it's what worked for me :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events