Required Modification in Existing fix script of RITM Stages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 01:01 AM
Actually i need modification in existing script only.
Requirement: In existing script need to add that if approval is requested then no need to pick up that RITM in list ,also required list of RITMs whose stages are Waiting for Approval (value 1)and fulfillment(value 2)
please refer below URL and guide me to add stages and approvals in existing script
Solved: To pick RITM which are in open state once after th... - ServiceNow Community
var arr = []; var gr = new GlideRecord("sc_req_item"); gr.addEncodedQuery("state=1"); // state is open gr.query(); while(gr.next()) { var closedCount = 0; var taskRec = new GlideRecord("sc_task"); taskRec.addQuery("request_item", gr.sys_id); taskRec.query(); var totalCount = taskRec.getRowCount(); while(taskRec.next()){ if(taskRec.active.toString() == 'false'){ closedCount++; } } if(closedCount == totalCount && totalCount != 0){ // if count is same then all tasks are closed then push RITM number in array arr.push(gr.getValue('number')); } } gs.print(arr.toString());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 02:35 AM
Requirement again
write a script to pick RITM which are in Open, WIP, Pending state once after the closure of child tasks (catalog tasks and approval tasks)
In existing script need to add that if approval is requested then no need to pick up that RITM in list , also required list of RITMs whose stages is not complete, Request Cancelled, closed_incomplete, closed_skipped.
but now instead of getting the approval field in query can you write a script like on approval table similar to sc_task ? (I don't want approval query in encoded query can you please write it in approval table?
can you please provide the updated script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 11:00 PM
Hi