Hello everyone,
I want to perform a transition via the JIRA REST API.
For this transition I have a custom field "Time Spent" with a "required" validator.
I try to post:
{ "timespent": "1h", "transition": { "id": "21"} }
The response sent by the server will be 204, indicated success, but the issue still on the previous stage. I try to post:
{ "fields": { "timespent": "1h" }, "transition": { "id": "21"} }
and even:
{ "fields": { "worklog": {"timespent": "1h"} }, "transition": { "id": "21"} }
The response sent by the server will be 400 Bad Request. The issue still on the previous stage.
What I should post to perform a transition?
Community moderators have prevented the ability to post new answers.
To update worklog while doing transition you have to use update filed:
{ "transition": { "id": "711" }, "update": { "worklog": [ { "add": { "timeSpent": "2m" } } ] } }
This worked fine for me when POSTed to /rest/api/2/issue/TST-80/transitions.
I suppose that there is a bug in the REST API, I've noticed that if a transition validator validates false so does the REST API not return the validation error but 204 istead. It shoud actually return the error message of the validator.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the answer!
There is a bug https://jira.atlassian.com/browse/JRA-33909 - JIRA REST does not return errors on transitioning an issue.
I want to know what query is correct?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is possible if you do not have a transition screen with the timeSpent field that the value is ignored.
The same happens with the comment.
I would suggest you update the issue first with a sepparate REST API call and then push it to another status.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
did you tried something like this
{ "started": "2013-08-23T16:57:35.985+0200", "timeSpent": "3h 20m", "timeSpentSeconds": 12000, "id": "100028", "transition": { "id": "21"} }
check this
https://docs.atlassian.com/jira/REST/latest/#d2e1573
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the answer!
I try:
{ "started": "2013-08-23T16:57:35.985+0200", "timeSpent": "3h 20m", "timeSpentSeconds": 12000, "transition": { "id": "21"} }
and receive 204, but the issue still on the previous stage.
try:
{ "fields": { "started": "2013-08-23T16:57:35.985+0200", "timeSpent": "3h 20m", "timeSpentSeconds": 12000 } "transition": { "id": "21"} }
and receive 400 Bad Request
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.