Is it possible to update the Stage of a RITM via REST api

Patrick Delaney
Kilo Contributor

I'm wondering if it is possible to modify the stage of a RITM via REST API?

 

 

13 REPLIES 13

Mike Patel
Tera Sage

Yes, you can. you will need to know RITM number or sys_id of it.

Example:

var gr = new GlideRecord("sc_req_item");
gr.addQuery("sys_id", request.sys_id);
gr.query();
if (gr.next()) {
    gr.stage = 'Completed';
    gr.update();
}

Sajilal
Mega Sage

Hi,

Yes you can use the PUT method.

PUT https://YOURINSTANCE.service-now.com/api/now/table/sc_req_item/RECORDSYSID.

{"stage":"delivery"}

Please Mark as Correct if this solves your issue and also mark ???? Helpful if it helps resolve your problem.

Thanks,
Saji

Patrick Delaney
Kilo Contributor

I tried the Put and sent the following json:

{
    "stage": "Ready for testing",
    "short_description": "Captiva Request 999"
}
 
 
The short description updated in the string that was returned, but the stage stayed  in "Work in progress"
 
@Mike Patel  Unfortunately I'm not familiar with the the code snippit that you shared. It needs to be via a rest call.

Check the choice list for the stage field and put in the Value instead of Label

Thanks,

Saji