Trigger RITM Approvals in Request flow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 06:58 AM
Hello Folks,
I have a requirement to trigger approvals on RITM level in a workflow which is on Request, Can some one please help me to achieve this. I have described my requirement below.
I can achieve it by creating workflow on rimt and can associate to specific cat item. So the ritm flow runs only after the request is approved. here I need this approval in between request approvals.
Thanks
Ram

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 07:14 AM
Hi kalyan,
In your workflow, after your first two approvals, generate an approval to RITM table with a run script activity.
You can try below code in run script activity
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('request',current.sys_id);
ritm.query();
if(ritm.next()) //assuming there is only one RITM under REQ. If more than one then use while instead of if
{
var ritm_sys_id = ritm.sys_id;
}
var approval = new GlideRecord('sysapproval_approver');
approval.initialize();
approval.setValue('sysapproval',ritm_sys_id);
approval.setValue('approver','sys_id_of_approver user');// give approver sysid here
approval.setValue('state','requested');
approval.insert();
After this run script activity you can put a wait for activity and proceed with the flow.
Mark as correct and helpful if it works.
Regards,
Sumanth