Show the number of Child tasks of Parent task?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 02:28 AM
How to Create Script to show the number of child tasks of Parent task ?
Expected output : Number of Incidents : 23
Please anyone help me with this
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 02:43 AM
Hi Rams,
you can use the following code:-
var count=0;
var gr=new GlideRecord('incident');
gr.addQuery('sys_id','sys_idOfIncident');
gr.query();
if(gr.next()){
var gre=new GlideRecord('incident');
gre.addQuery('parent_incident','sys_idOfIncident');
gre.query();
while(gre.next()){
count++;
}
}
gs.log(count);
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 02:53 AM
Hi Kunal,
Where can I execute this code . Can I write an email script or any other option ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 01:39 AM
How is this looks Email script to you? is your question related to Email by any chance?
Please share what you have done till now