I love working with the Jira REST API, but i've hit upon a problem I can't understand: When trying to create a new issue (POST, Jira OnDemand), it won't accept the 'priority' field:
{ "fields": { "project": { "key": "SAND" }, "issuetype": { "name": "Task" }, "priority": { "name": "Critical" }, "summary": "Testissue", "description": "Which is supposed to be critical" } }
The error message I get is Field 'priority' cannot be set. It is not on the appropriate screen, or unknown.
I have also tried to set the priority by id: "id": "2", which gives me the same error message.
If I leave out the 'priority' field, the issue gets created and I can set the priority by updating the issue directly (PUT):
{ "fields": { "priority": { "name": "Critical" } }
According to the Jira 5 REST API documentation, this should work in the initial POST to, insted of requiring two requests.
Community moderators have prevented the ability to post new answers.
Is the field available on 'Create' screen? Or is it only there on 'Edit' screen? Check by creating the issue on UI.
Ah, you're right. 'Priority' is indeed only visible on the 'Edit screen'.
I did not know that these screens have such an impact on the API, thank you for the heads-up.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just an added validation. REST allows only what you do via the UI ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am facing problem while making a post request to create an Issue via rest api. Do you mind telling me the platform you are using to make the POST request to the APIs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.