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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That should just work fine. Are you sure the fields that you expect are there on Create screen?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.