need to get entire details about a incident

Mr_Blue
Tera Expert

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...... ]

1 ACCEPTED SOLUTION

it would be parent_incident , 

 

rl.addQuery('parent_incident', dts.sys_id);

View solution in original post

29 REPLIES 29

I posted the code at the end of my previous post

var inc = new GlideRecord("incident");
var parentNumber = "INC0007001";
inc.addQuery("parent_incident.number", parentNumber);
inc.query()
while (inc.next()) {
    gs.print(inc.number + " is child incident of " + parentNumber);
}

If you have a developer instance then you can start the exact code in background script (INC0007002 and INC0007001 exist on every developer instance as test data). You will see

INC0007002 is child incident of INC0007001

 find_real_file.png

Hello Oleg, Thanks Alot for helping me 🙂

Mr_Blue
Tera Expert

Thank you all for helping me here 

Harsh Vardhan
Giga Patron

Glad i helped you.

kindly mark my response as correct and close this thread. 

 

yup, Done already 🙂