Skip to content

Commit 9c0a811

Browse files
List of child incidents of all Parent Incidents (#1060)
* Create allChildIncidents.js * Create readme.md * Update allChildIncidents.js Updated Code * Update readme.md Updated. * Update allChildIncidents.js Updated the code. * Update readme.md * Update allChildIncidents.js * Create allChildIncidents.js This code will show all the Incidents who are Parent Incidents based on filter condition query with how many Child Incidents they have. * Create readme.md * Delete GlideRecord/List of Child Incident of All Incidents/allChildIncidents.js GlideRecord commits need to be removed * Delete GlideRecord/List of Child Incident of All Incidents/readme.md GlideRecord commits need to be removed --------- Co-authored-by: Laszlo <[email protected]>
1 parent f1937fa commit 9c0a811

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var inc = new GlideAggregate('incident');
2+
inc.addEncodedQuery('parent_incidentISNOTEMPTY'); // This encoded query can be modified to more condition based on requirement.
3+
inc.groupBy('parent_incident');
4+
inc.addAggregate('COUNT');
5+
inc.query();
6+
7+
8+
while(inc.next())
9+
{
10+
gs.info('Number of Child Incident of '+ inc.getDisplayValue('parent_incident')+ ' are ' +inc.getAggregate('COUNT')+ '.');
11+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This code will show all the Incidents who are Parent Incidents based on filter condition query with how many Child Incidents they have.

0 commit comments

Comments
 (0)