- 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:31 AM - edited 08-02-2023 02:32 AM
Hello @nameisnani ,
Did you set the active field to false in workflow by using "set values" activity when the state is closed complete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 02:36 AM
There are some 50+ catalogue are there, it's really very tough to see and update all , instead of doing this can u provide me the BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 02:42 AM
can you please read the following article and make the changes accordingly
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0957617
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 02:37 AM
Is this happening only for particular catalog item's RITM or for all RITMs?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 02:39 AM - edited 08-02-2023 02:39 AM
Yes , it is happening randomly. @Ankur Bawiskar