- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 03:34 PM
Hello Community,
I would like to set a BR on RITM, When the assigned to field is true, then the SCTASK state change to WIP.
Thanks for your input.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 08:53 PM
@NDIAYE you can achieve this with a business rule on the sc_req_item table
set it to run on update when assigned_to changes (you can change this to whatever fits your requirements best)
and have it run this script:
(function executeRule(current, previous /*null when async*/) {
if (current.assigned_to != ''){
//query sc_task table
var sctask = new GlideRecord('sc_task');
sctask.addQuery('request_item',current.sys_id);
//update state
sctask.setValue('state',2);
sctask.updateMultiple();
//notify fulfiller
gs.addInfoMessage('Updated state of child tasks');
}
})(current, previous);
if the assigned to has changed, and the new value is not empty, it will query sc_task table for any records associated with that request item, update the state and add an info message.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 08:53 PM
@NDIAYE you can achieve this with a business rule on the sc_req_item table
set it to run on update when assigned_to changes (you can change this to whatever fits your requirements best)
and have it run this script:
(function executeRule(current, previous /*null when async*/) {
if (current.assigned_to != ''){
//query sc_task table
var sctask = new GlideRecord('sc_task');
sctask.addQuery('request_item',current.sys_id);
//update state
sctask.setValue('state',2);
sctask.updateMultiple();
//notify fulfiller
gs.addInfoMessage('Updated state of child tasks');
}
})(current, previous);
if the assigned to has changed, and the new value is not empty, it will query sc_task table for any records associated with that request item, update the state and add an info message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 01:32 PM
Hi @Kai Tingey Thanks so much for your help here
Your proposal looks like what I expected. I will test it shortly and will be back to you.