- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 02:11 AM
Hi,
I want to close incident task when incident is closed. When anyone close incident then it should check incident task has been closed or not if it incident task has been closed then incident should closed.
Can anyone please help me with this.
Regards,
Nivedita
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 02:18 AM
create an after update BR on incident table with condition state changes to closed, with below script:
var inc = new GlideaRecord('incident_task');
inc.addQuery('incident',current.sys_id);
inc.addEncodedQuery('stateIN-5,1,2'); // will check if task is not closed
inc.query();
while(inc.next())
{
inc.state=3; // will close the task
inc.update();
}
Please mark the answer correct/helpful accordingly.
Raghav
MVP 2023

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 11:54 AM
Point 1 can be controlled with Property I have mentioned, no additional thing is needed. For point 2 you need business rule , you can see below thread it has working code.
Feel free to accept multiple solutions if your query is answered.
Regards,
Musab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 11:54 AM
Point 1 can be controlled with Property I have mentioned, no additional thing is needed. For point 2 you need business rule , you can see below thread it has working code.
Feel free to accept multiple solutions if your query is answered.
Regards,
Musab