Difference in States REQ and RITM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2023 02:24 AM
For any closed incomplete or closed skipped RITM, the corresponding REQ shows state Closed Complete.
I believe this is done automatically at closure of the RITM.
This needs to be resolved so that when the RITM is closed skipped or closed incomplete, the associated REQ state is also set to closed skipped or closed incomplete.
I want to fullfill this by business rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2023 02:35 AM - edited ‎10-18-2023 02:38 AM
Hi @abc1233 ,
Please note make sure we have similar kind of states available in Request table as well.
Certainly, you can achieve this by creating a Business Rule in ServiceNow. Here's how you can create a Business Rule to update the state of the associated Request (REQ) when its corresponding Requested Item (RITM) is closed skipped or closed incomplete.
### Step 1: Create a Business Rule
1. Go to **Business Rules** in your ServiceNow instance.
2. Click on **New** to create a new Business Rule.
3. Provide a name for the Business Rule, such as "Update REQ State on RITM Closure."
4. Set the **Table** to the Requested Item (RITM) table (usually `sc_req_item`).
5. Define the **When to run** condition. This condition checks if the RITM is being closed skipped or closed incomplete.
current.state == 6 || current.state == 7
- `6` represents "Closed Incomplete" state.
- `7` represents "Closed Skipped" state.
6. In the **Advanced** tab, add the following script to update the corresponding Request's state:
(function executeRule(current, previous /*null when async*/) {
// Check if the RITM has a corresponding REQ
if (current.request) {
var req = new GlideRecord('sc_request');
if (req.get(current.request)) {
// Set REQ state to match RITM state
req.state = current.state;
req.update();
}
}
})(current, previous);
7. Save the Business Rule.
With this Business Rule in place, whenever an RITM is closed skipped or closed incomplete, the corresponding REQ's state will be updated accordingly to match the state of the RITM. Make sure to test this in a non-production environment before applying it to your live instance.
Thanks,
Danish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2023 02:45 AM
Hi @abc1233 You can write a after update BR on Request item table
cond: state changesTO closed Complete
or State ChangesTO Closed Skipped
Script:
var req = new GlideRecord('sc_request');
req.addQuery('sys_id',current.request);
req.query();
if(req.next())
{
if(current.state == 4) // closed incomplete
{
req.state = 4;
req.update();
}
else if(current.state == 7) // closed skipped
{
req.state = 7;
req.update();
}
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2023 03:51 AM
Hi @Harish KM
Above one is working fine for SCtask -> RITM
but I want SCTask -> RITM -> REQ
Means,
When filtering on SCTASKs that are in state Closed Skipped or Closed Incomplete, I can get a list of the SCTASKs and the associated RITMs and REQs.
For any closed incomplete or closed skipped SCTASK, the corresponding RITM shows state Closed Complete.
In addition, the corresponding state of the REQ also shows as Closed Complete.
I believe this is done automatically at closure of the SCTASK.
This needs to be resolved so that when the SCTASK is closed skipped or closed imcomplete, the associated RITM state is also set to closed skipped or closed incomplete.
I need to Fulfill this by Business rule
can you please help?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2023 07:22 PM
Hi @abc1233 You can use below BR on sc_task table
Harish