Incident Not allowed to Close
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2024 04:51 PM
Hi I have a requirement ...
Incident should not be allowed to resolve if there are any incident tasks in an open state ,and it show through an alert "Please close incident tasks before resolving the incident". Using Script make it possible and explain the complete process of how to do ...
Thank You!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2024 05:05 PM
Hi @Hitesh Ramba check below script
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");
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 04:59 AM
Why are you asking the same question three times?
What did you already try yourself? What kind of assignment is this? Did you try something already, or are you just asking others to do your work for them?
https://www.servicenow.com/community/product-launch-forum/scripting-assignment/td-p/2918571
https://www.servicenow.com/community/product-launch-forum/incident-task/td-p/2919123
https://www.servicenow.com/community/product-launch-forum/incident-not-allowed-to-close/td-p/2919124
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark