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

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

2 answers

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).

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.

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

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

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
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

26,386 views 2 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you