- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2020 08:46 PM
Hi Priya,
If you observe the script part in mark for auto close BR :
It is checking for action status plugin being inactive or needs attention being inactive.
In my scenario I didn't had much concern with action status plugin so I made this plugin inactive and created a simple BR i.e. advanced unchecked, and I kept the condition same as this BR. And in the set value part I simply put auto close to true. PFB :
No need of advanced script part you do not rely on this plugin. Additionally, you can also modify this plugin as I created a new one in my case.
Hope this helps you.
EDIT:
One more thing you can do is that create an after update advance BR with the same condition. Add one more condition to it as state changes to resolved. In the script part check if for the current case all the blocked by task in sn_action_status_blocked_by table is unblocked then set auto close to true. You can use below script and check if it satifies your use case :
(function executeRule(current, previous /*null when async*/ ) {
var blocked = false;
var gr = new GlideRecord('sn_action_status_blocked_by');
gr.addQuery('blocked_task', current.sys_id);
gr.query();
while (gr.next()) {
if (gr.unblocked_on == '') {
blocked = true;
}
}
if(!blocked){
current.auto_close=true;
}
})(current, previous);