- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2016 01:59 PM
I am working on a Catalog Item that runs in the Request workflow. This item does not generate any task. The Request workflow will only request an approval and if approved, it will send an email to certain people. I added a set value that will put the Stage as Closed Complete and the State as Closed Complete but this is still keeping the RITM active and in a Stage of "Nothing".
Again, this is not running on any Requested item workflow, only on a request workflow.
Do you have any suggestion on how to make this work?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2016 05:22 PM
Hi Yonanthan,
If there is no BR or RITM workflow controlling the stage for the RITM, then you may need to set it as well in the same script:
while(gr.next()){
gr.state = 3; // State value for "Closed Complete"
gr.stage = (whatever end-stage value you have);
gr.update();
}
Generally though, 'stage' is used in workflows. If you don't have a RITM workflow, this is probably why it is not updated and you will have to update it manually as in the script above.
-Brian

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2016 02:07 PM
Hi Yonathan,
Nothing is getting set on the RITM because, as you said, this is a workflow on [sc_request]. From the parent request's workflow, you could use a Run Script activity to find and update (i.e., close) the RITM.
To do so, add a Run Script activity to your workflow after your Set Values activity, and enter this as the script:
var gr = new GlideRecord('sc_req_item');
gr.addQuery('request', current.sys_id);
gr.query();
while(gr.next()){
gr.state = 3; // State value for "Closed Complete"
gr.update();
}
See how that works for you.
Thanks,
-Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2016 02:17 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2016 05:22 PM
Hi Yonanthan,
If there is no BR or RITM workflow controlling the stage for the RITM, then you may need to set it as well in the same script:
while(gr.next()){
gr.state = 3; // State value for "Closed Complete"
gr.stage = (whatever end-stage value you have);
gr.update();
}
Generally though, 'stage' is used in workflows. If you don't have a RITM workflow, this is probably why it is not updated and you will have to update it manually as in the script above.
-Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2016 01:20 PM
Thanks. I was able to get it Completed with this information.
I appreciate your assistance.