Once sub task is closed then parent task state should change to work in progress
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 05:54 AM - edited 02-22-2024 05:55 AM
Hi,
I'm looking into requirement. once the subtask is closed then parent task state should chnage to workinprogress.
Please help me to complete this task.
Parent: sn_si_incident
child: sn_si_task
Regards,
Sanju.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 07:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 06:41 AM - edited 02-22-2024 06:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 06:56 AM
Hello @Talari Balateja -
newTasks.addEncodedQuery(//add encoded query here to match the parent record on child table);
In my above code I have already mentioned that you have to put query to match parent record on child table do not put state should be close complete here then it will not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 07:24 AM
Hi @Pratiksha2
updated encodedquery and not working
var newTasks = new GlideRecord("sn_si_task");
newTasks.addEncodedQuery('substate', '7');
newTasks.query();
var flag = false;
while (newTasks.next()) {
if (current.state != '3') {
flag = true;
}
}
if (flag == false) {
var grTask= new GlideRecord("sn_si_task");
grTask.addEncodedQuery('substate', '7');
grTask.query();
if(!grTask.next()){
var incidentReq = new GlideRecord("sn_si_incident");
if (incidentReq.get(current.number)) {
incidentReq.setValue('substate', '4');
incidentReq.update();
}
}
}
