- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2022 11:45 PM
Hi Team,
I am working on a workflow part to skip the approvals based on RITM string value. Below the process.
We will create a SOW request through the sc_task. Here, i have to skip the approval based on the given value from RITM variable.
i have variable solution center (Single line text) Here based on the value i should skip the approval. If users give only "Rollouts" then approvals should be skipped in the workflow.
The workflow is in sow module table. So i am using below script gliding the sc_req_item table and trying to set YES / NO in IF condition. But this is not working.
answer = ifScript();
function ifScript() {
var gr1 = new GlideRecord('sc_req_item');
gr1.addQuery('sys_id', requesteditem);
gr1.query();
if (gr1.next()) {
var solutioncenter = gr1.variables.u_solution_center;
gs.log('solutioncenter' + solutioncenter, 'a360879');
if (solutioncenter == "Rollouts") {
return 'yes';
}
else {
return 'no';
}
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2022 01:11 AM
Hi,
you didn't share this info
in your script you have not defined what does the variable requesteditem holds?
are you sure it holds RITM sysId
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2022 11:41 PM
Hi Ankur,
i have used direct sow table and it works 🙂
Thanks...