The CreatorCon Call for Content is officially open! Get started here.

Unable to modify change request task state via REST API

Philip Mihaylov
Kilo Contributor

Hello,

I'm trying to modify the state of change management task via the following call

Request: PATCH call on /sn_chg_rest/change/<requestID>/task/<TaskID>

Body: {"work_notes":"updating", "state":"In Progress"}

The call is successful, new work notes are added to the task, but the state remains open.

I also tried with "state":"in progress", "state":2.0. Nothing works...

 

Thanks and Best Regards,

Philip

1 ACCEPTED SOLUTION

@Philip Mihaylov was you able to achieve what was required? Please let me know if you need more help.

View solution in original post

5 REPLIES 5

P-Rudenko-SN
ServiceNow Employee
ServiceNow Employee

Are you using the out-of-the-box change state values? If yes, I believe the 'state' field value has to be set as number. Adding the screenshot from my PDI.

find_real_file.png

Philip Mihaylov
Kilo Contributor

Thanks, Pavlo,

Yes I'm using out-of-the-box change state values, but unfortunately it doesn't work even with numbers...

 

Can you try to test via the different namespace and method? I was able to update the Change Request using the following:

PUT https://{instance_name}.service-now.com/api/now/table/change_request/{change_request_sys_id}

{"state":"-3","work_notes":"Updating"}

@Philip Mihaylov was you able to achieve what was required? Please let me know if you need more help.