Forums

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

Can i take mandatory fields through restAPI request?

Diana
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!
November 10, 2021

I would like to get the mandatory fields of a Jira Project through a restAPI request. 
Is that possible?

I can not find this in the documentation.

1 answer

1 accepted

1 vote
Answer accepted
Thomas Deiler
Community Champion
November 10, 2021

Dear @Diana ,

yes, you can.

First get the IDs of all issue types of one project:

GET /rest/api/2/issue/createmeta/{projectIdOrKey}/issuetypes

Then get all meta info of one issue type:

GET /rest/issue/createmeta/{projectIdOrKey}/issuetypes/{issueTypeId}

The response contains an entity "required". It's true for mandatory fields.

Example

...
{
"required":true,
"schema":{
"type":"user",
"system":"reporter"
},
"name":"Reporter",
"fieldId":"reporter",
"autoCompleteUrl":"http://myjira/rest/api/latest/user/search?username=",
"hasDefaultValue":false,
"operations":["set"]
}
...

So long

Thomas

Diana
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!
November 11, 2021

Thank you for the answer! Works perfectly!

Suggest an answer

Log in or Sign up to answer