- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2019 04:08 AM
Hello Guys,
What i want is ::> Need entire details about a ticket in "Script-background", All details like [ Child ticket, assigned to, Assigned group, summary, create on, and so on...... ]
Below code is not even showing me "Script-background", but its not giving me any output
var dts = new GlideRecord('incident');
dts.addQuery('number','INC0010120');
dts.query();
if(dts.next()){ dts.info(' exists'); } else { dts.info('does not exists'); }
Can some one please show me how to get all the details about a ticket in code [ Child ticket, assigned to, Assigned group, summary, create on, and so on...... ]
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2019 07:26 AM
it would be parent_incident ,
rl.addQuery('parent_incident', dts.sys_id);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2019 05:16 AM
Yes, i have used the entire code but i am not getting all the records,
this is what i am getting as output :
*** Script: Assigned To
*** Script: Assigned ToCAB Approval
*** Script: Assigned Toundefined
can you please check and please help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2019 05:31 AM
do you have any specific number of columns which you want to get?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2019 05:37 AM
All i want is, To display child ticket no of ticket :INC0010120
once i get the child ticket no, its a success

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2019 05:43 AM
var dts = new GlideRecord('incident');
dts.addQuery('number','INC0010136'); // pass the incident number which has child incident attached .
dts.query();
if(dts.next()){
var rl = new GlideRecord('incident');
rl.addQuery('parent_incident', dts.sys_id);
rl.query();
gs.print('Row Count is '+rl.getRowCount());
while(rl.next()){
gs.print('Child incident'+rl.number);
}
} else {
gs.print('does not exists');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2019 05:52 AM
i have pasted the ticket id which has child ticket, but its giving me 0 count.
i am using kingston version