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

AbhishekGardade
Giga Sage

Hello Bright,

Do you want to show all the field and values from incident table ?

var dts = new GlideRecord('incident');
dts.addQuery('number','INC0010124');
dts.query();
if(dts.next()){
gs.print(' Caller: '+dts.caller_id);
gs.print(' Caller: '+dts.getDisplayValue('caller_id'));
gs.print(' Priority: '+dts.priority);
gs.print(' category: '+dts.category);
gs.print(' Short Desc: '+dts.short_description);
}
else
{
gs.print('does not exists');
}

Thanks,

Abhishek

Thank you,
Abhishek Gardade

Hello Abhishek, 

Yes, Actually all values of incident : INCXXXXXXX 

[ Child ticket, assigned to, Assigned group, summary, create on]

specially Child ticket, i want to see  

Hello Bright,

Run this, you will get your output values for all fields.

var gr = new GlideRecord("incident");
if (gr.get("2afb3acb1b5e3300364d32a3cc4bcb64"))// sys_id of incident

{

for (var prop in gr) {

gs.print(prop + ":" + gr[prop]);

}

}

Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade

Thank you,
Abhishek Gardade

hello Bright,

Have you tested this code?

thanks,
Abhishek

Thank you,
Abhishek Gardade