- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 12:42 AM
Hi All ,
I am facing the below issue in my ServiceNow instance wherein the status of the field Active of the RITM's sometimes are not changing to false when the state is 'Closed completed' because of which the RITM's are showing up in service portal widget' My request' Closed Complete' option .
Any suggestions on this/ or anyone has faced similar issue.
I feel writing a business rule on RITM table will work , however wanted to understand why its happening when for the same catalog item.
can anyone please root cause for this .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 01:14 AM
@SunilKumar Padh can you check any catalog tasks are open under those req items??
and also no need to write business rule there is already one oob provided for this.
Bharath Chintala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 02:18 AM
HI @Harshal Aditya & @BharathChintala
Thanks for the reply .
where i need to update in OOB business rule .
could you please suggest here .
condition -
current.stage.changes() && (current.stage=="complete" || current.stage=="Request Cancelled" || current.stage=="closed_incomplete" || current.stage=="closed_skipped")
Script -
(function executeRule(current, previous /*null when async*/ ) {
current.active = false;
// Delivery Plan Specific, update the state here, so that TaskStateUtil, won't be able set the state.
if (!current.delivery_plan.nil()) {
if (current.stage == 'closed_incomplete' || current.stage == 'Request Cancelled')
current.state = 4;
else if (current.stage == 'closed_skipped')
current.state = 7;
}
// If we started a workflow for this item, cancel it
if ((current.stage == 'Request Cancelled') && current.context && !current.context.nil()) {
var w = new Workflow();
var gr = new GlideRecord('wf_context');
if (gr.get(current.context))
w.cancelContext(gr);
}
})(current, previous);
can anyone please provide me the updated script .
Thanks in Adavance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 02:49 AM
make the OOB inactive and create similar BR with Modified Advanced Conditions.
Or else Modify the Workflow being used by your Request Item so that the Stage is set to one of the expected values. (E.g. complete, Request Cancelled, closed_incomplete or closed_skipped)
Please hit the thumb and Mark as correct if it helped!
Kind Regards,
Ravi Chandra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 02:39 AM
The ootb rule manages active but it is linked to stage and not state. So as you can see you need to manage the stage not just the state. What are you using as a process engine on those cat items that produce the ritms?