- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 08:37 AM
I need for the linked RITM to be set to 'Pending' when any of the associated SCTasks are set to 'Pending'
When none of the associated SCTasks are pending, the RITM needs to move back to 'Work in Progress'
Can anyone help please?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 04:03 AM
After BR on SCTask table
Conditions
State changes from pending
and request_item.state is not WIP
On insert and update
in advance Script
var task = new GlideRecord('sc_task');
task.addQuery('request_item',current.request_item);
task.addQuery('state','-5');// replace back end value mostly it will be numeric value
task.query();
if(task.next()){
//do nothing
}else{
var gr = new GlideRecord('sc_req_item');
gr.get(current.request_item);
gr.state = 'WIP';// replace back end value mostly it will be numeric value
gr.update();
}
My bad that should be not != just pending try above code
Bharath Chintala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 06:48 AM
Apologies!
I replaced your code but didn't change the 'WIP' value. I have done so now and it works.
Many thanks! Really appreciate your help.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 09:00 PM - edited 02-14-2024 09:00 PM
Hi,
Can you please paste both the scripts here.
Thanks in advance.