Forums

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

Jira API call to get issue type fields metadata

George Remus November 6, 2024

Hi everyone. I am trying to get all the fields metadata for a specific project issue type so I can render different inputs for different issue types of different projects.

 

I am currently doing a GET HTTP request via Insomnia to the following URL:

my_base_url/rest/api/2/issue/createmeta?projectKeys=MY_PROJ_KEY&expand=projects.issuetypes.fields

 

The base url and project key are 100% correct but I get the following error when doing the HTTP call:

 

{ "errorMessages": [ "Issue Does Not Exist" ], "errors": {} }

 

Other v2 API calls work. The question is, what is the issue here or what other ways do I have to get the create metadata fields for a specific project and issue type.

2 answers

1 accepted

0 votes
Answer accepted
Bill Sheboy
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.
November 6, 2024
George Remus November 7, 2024

Hi Bill. Thank you for the response.

The issue is that the https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-createmeta-projectidorkey-issuetypes-issuetypeid-get you talked about does not return information of what types of fields to be rendered in the UI. like for example for what fields to load what type of input(e.g. autocomplete, select, multiselect, textfield etc). I need this because I want to render a jira create issue form and the inputs differ for project and issueType combination.

 

The API endpoint that I see it should help me is this one: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-get because I can give the expand query param, and apparently it should return the information I need about the fields. But the issue here is that, if I call this API endpoint I always get this response:

{
"errorMessages": [
"Issue Does Not Exist"
],
"errors": {}
}

with status code 404. Could it be some permissions issue?

Bill Sheboy
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.
November 7, 2024

That v2 one still works for me for an example project, as you have called it.  Have you tried using a different user's credentials (or API token)?

And...you may have noticed that v2 endpoint is deprecated: https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1304

And so with the new one, I suspect each field's information would need to be checked with additional calls.

George Remus November 7, 2024

Solved it. It was some permissions issues and this is why I was not able to get the fields metadata. Thank you.

Like Bill Sheboy likes this
0 votes
Radek Dostál
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.
November 6, 2024

You're not using REST API documentation for the right version of Jira.

Suggest an answer

Log in or Sign up to answer