Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Does Jira allow to update "state" field of Sprint using REST API ?

Ashwini Upasani December 23, 2020

We were trying to update the "state" filed of Jira Sprint using API. 

 

We are not able to update it, we are getting the below error.

 

 OH-JIRA-0222: An internal error occurred when getting the issue information. Server Error : 500 , response from server is : <?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>500</status-code><message>Unrecognized field "state" (Class com.atlassian.greenhopper.api.rest.bean.SprintCreateBean), not marked as ignorable at [Source: org.apache.catalina.connector.CoyoteInputStream@6bd864a2; line: 1, column: 1075] (through reference chain: com.atlassian.greenhopper.api.rest.bean.SprintCreateBean["state"])</message><stack-trace>org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "state" (Class com.atlassian.greenhopper.api.rest.bean.SprintCreateBean), not marked as ignorable at [Source: org.apache.catalina.connector.CoyoteInputStream@6bd864a2; line: 1, column: 1075] (through reference chain: com.atlassian.greenhopper.api.rest.bean.SprintCreateBean["state"]) at

1 answer

0 votes
Nic Brough -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.
December 24, 2020

I suspect you've tried to do this as though state is an issue field.  It is not, it is a sprint property.

You can only make some changes to state of a sprint, the ones the UI allows you to do.  See the REST API at https://docs.atlassian.com/jira-software/REST/7.3.1/#agile/1.0/sprint-updateSprint

Ashwini Upasani December 24, 2020

We were trying to update the state of Sprint where the state is property of Sprint Entity.

API: http://10.13.27.105:8080/rest/agile/1.0/sprint/74851

Request Body :

{"name":"Sprint testing"endDate":"2020-12-29T13:18:00.000+0530","startDate":"2020-12-23T13:18:00.000+0530","originBoardId":20,"state":"Active"}

Nic Brough -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.
December 24, 2020

Have you checked that the state is ok to set?  The doc I pointed at shows you some rules about what you can change with the call.

If your call is valid and allowed, then you'll need to look for another cause of the "Internal server error" - the application log should have a block of log that tells you what has gone wrong.

Ashwini Upasani December 24, 2020

Yes, the state is ok to set. Still it is not allowing it.

 

Whether the state is read-only in Jira ????

Nic Brough -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.
December 24, 2020

It is in some cases, as stated in the doc.

But I'd not expect it to give an internal server error if you try to set the state when it's not allowed, you do need to track that down by reading the application log.

Ashwini Upasani December 24, 2020

I am not able o find any reason in the logs for such an internal server error. It seems that Jira is not allowing to write/update the state field of the Sprint entity. "State" is working the "read only" for sprint.

 

Our Jira version: 8.13.1

Suggest an answer

Log in or Sign up to answer