Manually change stage of a requested item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2016 09:04 AM
I have a workflow that, upon ending, didn't change the Stage of the Requested Item. We have corrected the workflow, but I have several Requested Items that are actually complete but the stage is still Fulfillment. Is there a way to manually change the value on these entries?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2016 09:06 AM
Hi Leah,
You can run a background script to manually update those records. However background scripts are powerful so please try the script on dev first.
Background Scripts — ServiceNow Elite
http://wiki.servicenow.com/?title=GlideRecord#gsc.tab=0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2016 09:12 AM
Hi Leah,
That script would look something like this. Hopefully you don't have too many to do manually. I would avoid using a loop to update these as it could update too many of them.
var id = '(some sys_id of a request item record)';
var item = new GlideRecord('sc_req_item');
if (item.get(id)) {
item.stage = 'complete'; // Or appropriate value based on your stage definition
item.update();
}
If you want to avoid sending email after the fact, insert a line: item.setWorkflow(false); before the item.update() line.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2016 09:13 AM
OH! And TEST on a non-prod system first please.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2016 10:15 AM
To add to the script Chuck shared.
Use item.setWorkflow(false); before item.update(); in case you don't want to trigger business rule/notification to be fired when the ticket is updated from background script.