Case should not be closed if any of the RITM is open.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 07:40 AM
Hi All,
I have a requirement when RITM is opened then no one can close or resolve the Case and when RITM is Closed then Case should Closed.
Please help in this.
Thanks,
Samiksha
- Labels:
-
Customer Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 07:45 AM
Hey @Samiksha2 :
You can write a BR on the case table on state change to achieve this
BR to prevent closure of Case without closing RITM:
When to run : Before Update
Condition : When State > Changes > to Close /Resolve
In Script section
Check if any Request is not closed then abort the action
Let me know if you need help in the script part
Mark this as Helpful / Accept the Solution if this clears your issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 08:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 10:05 PM
@Samiksha2 Please find the below screenshot and the code snippet
(function executeRule(current, previous /*null when async*/ ) {
CheckActiveRequest();
function CheckActiveRequest() {
try {
var activereq = [];
var case_rel_req = new GlideRecord('sc_request');
case_rel_req.addQuery('parent', current.sys_id.toString());
case_rel_req.query();
while (case_rel_req.next()) {
if (case_rel_req.state == 'in_process' || case_rel_req.state == 'requested') { // Active State of Request
activereq.push(case_rel_req.number.toString());
}
}
if (activereq.length > 1) { // If we find any active request
gs.addErrorMessage('There are still active request ' + activereq + ' close those to close the case');
current.setAbortAction(true); // abort the closure of case
}
} catch (e) {
gs.info('Error in BR [Dont Allow Case Clousre] ' + e);
}
}
})(current, previous);
Mark this as Helpful / Accept the Solution if this clears your issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 11:54 PM
Hi @S Goutham ,
Thank you for your help. But still I can close the case if RITM or Request is active.