change the stage of a RITM manually
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2018 07:40 AM
Hi there, I have an RITM whose stage is stuck at Fulfillment due an incorrect workflow, which has been now corrected, however I have difficulty in changing the stage of the RITM from Fulfillment to Request Cancelled. Used below script but it's changing the state only in Form View. When looked at the List view, the record's stage still shows as Fulfillment.
Copied stage value from Workflow.
var gr = new GlideRecord('sc_req_item');
gr.addQuery('number','RITM0123456');
gr.query();
if(gr.next()){
gr.autoSysFields(false);
gr.setWorkflow(false);
gr.stage = 'Request Cancelled';
gr.update();
}
List View:
Form View:
Any help in this regard is really helpful. Thanks,
- Labels:
-
Request Management
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2018 10:09 AM
Please use below script to change stage of requested item
var gr = new GlideRecord('sc_req_item');
gr.addQuery('number','RITM0123456');
gr.query();
if(gr.next()){
gr.stage = 'Request Cancelled'; // please check correct stage choice list value from your instance
gr.autoSysFields(false);
gr.setWorkflow(false);
gr.update();
}
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2018 12:23 PM
We dont have the Request cancelled here in the choice list, however the other RITMs have the Request Cancelled stage which has been set from Workflow. Since this workflow has already been completed, is there a possibility to set the stage to Request Cancelled?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2018 02:59 PM
Please use below to cancel RITM from background script
var gr = new GlideRecord('sc_req_item');
gr.addQuery('number','RITM0123456');
gr.query();
if(gr.next()){
gr.stage = 'Request Cancelled'; // please check correct stage choice list value from your instance
gr.autoSysFields(false);
gr.setWorkflow(false);
gr.update();
}
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2021 12:16 PM
Thanks this worked for me. Just to add to this post for inexperienced people like me. I did this from Filter Navigator/Scripts-Background. I copied and pasted the above text and changed the ritm number and the stage to what I needed and it worked perfectly