- 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 03:50 PM
Hi @NDIAYE
Assigned to is what type of field? Usually it should be the reference type.
Also your question is not clear because let's say if you have three SCTASK associated with the RITM. Do you want to change all the three SCTASK state to WIP?
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 01:30 PM
Hello Murthy,
Thanks a lot for feedback , Yes I confirm it is a reference field. The aim being to change the state of all task associated to the RITM , In general all our items have only one task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 08:50 PM - edited 10-25-2023 08:53 PM
Hi @NDIAYE
There's OOTB Business Rule on the Incident [incident] table. You can mimic that one.
Name: Incident State Active on Assignment
URL: https://<instance_name>/sys_script.do?sys_id=6fab2e470a0007045931f2a692878933
Sample below.
Let me know if it works for you.
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 01:33 PM
hello @Tai Vu I will have a look on it