Background script to change the status of the RITM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2017 03:10 AM
CAN WE CHANGE THE STATUS OF RITM through background script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2017 03:16 AM
yes we can change the status of RITM, can i know what you want to update on RITM?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2017 03:16 AM
var gr = new GlideRecord('sc_req_item');
gr.addQuery('number', 'RITMxxxxx');
gr.setLimit(1);
gr.query();
if (gr.next()) {
gr.state = new state;
//gr.setWorkflow(false) - do this if you want to update the state without running workflow or business rules
gr.update;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2017 03:27 AM
Hi,
Yes it can be done using Background Script. Please refer the script below:
Script:
var gr = new GlideRecord('sc_req_item');
var string='active=true'; //Replace your query here.
gr.addEncodedQuery(string)
gr.query();
while(gr.next())
{
gr.setWorkflow(false);
gr.autoSysFields(false);
gr.state= '2'; //Replace '2' with your Complete status Value
gr.update();
}
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2017 07:38 PM
Hi,
If your query is Resolved, would you mind marking my answer as correct and close this thread.
Regards,
Shloke
Regards,
Shloke