How to change the state of a change using rest api?

sagar38
Kilo Explorer

I have created a standard change using the Standard  (POST) api. Now when I try to change the state of the change from New(-5) to Sheduled(-2) using the  Standard  (PATCH) api with Request Body as {"state":"-2"} it fails with 400 error. 

Following is the response body I get.

{
  "error": {
    "message": "Standard Change Request cannot move to state: -2",
    "detail": ""
  },
  "status": "failure"
}

What exactly am I doing wrong here, also what is the best way to go about debugging such issue because the error msg doesn't really give much to work on

 

2 REPLIES 2

AbhishekGardade
Giga Sage

Hello Sagar,

It seems their are some business rule is restricting your update. Can you try running it from background script or use try catch block.

Please mark as Correct Answer and Helpful, if applicable.
Thank You!
Abhishek Gardade

Thank you,
Abhishek Gardade

Abhishek-do you know what business rules those would be? I am having the same issue.