I want to find total no. of incidents which are having problem record and print those INC numbers.

Parth_S
Tera Contributor

Please have a look on my script -

 

var gr = new GlideRecord('incident');
gr.addEncodedQuery('problem_idISNOTEMPTY');
gr.query();
gs.print('found');
while(gr.next()){
    gs.print('INC are: ' + gr.number);
}
 
I don't know but I am not able to see any O/P in script background.
 
So pls can anyone correct me where did i made mistake and suggest me correct script.
7 REPLIES 7

Bert_c1
Kilo Patron

your script works for me in my PDI. Try a list view of incident records using the same filter.

Anand Kumar P
Giga Patron
Giga Patron

Hi @Parth_S ,

 

Issue resolved ? 

If my response helped, please mark it as the accepted solution and give a thumbs up👍.
Thanks,
Anand

Harish Bainsla
Kilo Patron
Kilo Patron

Hi @Parth_S  I have checked your script in Background  its working fine check below screen shot.

HarishBainsla_0-1734674198708.png

HarishBainsla_1-1734674213534.png

if my answer helps you mark helpful and accept solution.