REST API, issue/createmeta not returning fields when using expand=projects.issuetypes.fields

Nic Baumann July 23, 2012

Hey there,

When using the REST API and the issue/createmeta call to get the fields for a specific issue, the fields don't get returned, only the different issue types and some data about the project, when passing 'expand=projects.issuetypes.fields' and the project key and issue type like displayed on: https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Discovering+meta-data+for+creating+issues and documented on http://docs.atlassian.com/jira/REST/latest/ like so: rest/api/2/issue/createmeta?projectKeys=QE&issuetypeIds=1&expand=projects.issuetypes.fields

The only way the fields are returned is if I don't specify a project key and issue type and only 'expand=projects.issuetypes.fields', but then I get EVERY project in a HUGE JSON blob.

This is for JIRA 5.1.

Cheers

3 answers

3 votes
Aleksander Mierzwicki
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 19, 2013

How do you execute request? Are you 100% sure that you send proper URL - especially is the & character send properly to server? What happen if you pass expand= as first query parameter and then select project or issue type?

rest/api/2/issue/createmeta?expand=projects.issuetypes.fields&projectKeys=QE&issuetypeIds=1

If you run those queries from shell, then please make sure that you escapes URL with single quotes (shell interpretes ? and & characters when they are not escaped/quted).

Marco Schmelzer April 14, 2015

Thanks for your hint with the parameter order. The first try as explained on the following site does not work where the *expand* paramter is at the end of the url. https://developer.atlassian.com/jiradev/api-reference/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-create-issue#JIRARESTAPIExample-CreateIssue-Fieldmeta-dataforcreatingissues But if I set the expand parameter before the other it works. Not work: rest/api/2/issue/createmeta?projectKeys=QE&issuetypeIds=1&expand=projects.issuetypes.fields Works: rest/api/2/issue/createmeta?expand=projects.issuetypes.fields&projectKeys=QE&issuetypeIds=1 Maybe it is also the solution for the question author @Nic Baumann.

Like # people like this
Aleksander Mierzwicki
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 17, 2015

How do you execute this requests? It sounds like your request is being cut after &, which often happens when you try to execute request from command line - as (linux) shell uses & as 'run in background' - so it need to be escaped properly.

0 votes
Alexey Kubasov February 20, 2019

Had the same problem until not changed the parameters order.

Use the expand parameter first like

.../createmeta?expand=projects.issuetypes.fields&projectIds=0&issuetypeIds=0

rather than

.../createmeta?projectIds=0&issuetypeIds=0&expand=projects.issuetypes.fields

0 votes
Jobin Kuruvilla [Adaptavist]
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.
July 23, 2012

That should just work fine. Are you sure the fields that you expect are there on Create screen?

Nic Baumann July 23, 2012

I've tried every combination. Using issue id, issue name, project ID, project key, in different combinations for different projects. Everything. The only time I got fields was by only passing expand=projects.issuetypes.fields and nothing else.

Suggest an answer

Log in or Sign up to answer