- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2019 07:26 PM
Hi,
Incident should not resolved if any task are pending or open. once all the tasks are closed then only Incident can close/Resolved.
For example:
In an Incident there are 3 tasks are there if 2 tasks are closed and one is open/pending then if i close that incident it will not going to close.
Once all the tasks are closed then only Incident is get closed.
Please help me on the same.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2019 12:05 AM
Hi,
Try with below code
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr=new GlideRecord('incident_task');
gr.addQuery('incident',current.sys_id);
gr.addQuery('active',true);
gr.query();
if(gr.next())
{
current.setAbortAction(true);
gs.addInfoMessage("incident can not be closed untill all incident tasks should be closed or resolved");
}
}
Regards,
Pooja
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2019 12:05 AM
Hi,
Try with below code
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr=new GlideRecord('incident_task');
gr.addQuery('incident',current.sys_id);
gr.addQuery('active',true);
gr.query();
if(gr.next())
{
current.setAbortAction(true);
gs.addInfoMessage("incident can not be closed untill all incident tasks should be closed or resolved");
}
}
Regards,
Pooja
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2019 12:47 AM
Yes above updated code is working fine.
Thank you...pooja
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2025 11:38 PM
i have wrote the same code but my incident is being closed again and again what to do
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2021 07:46 AM