ITSM

HarithaP
Tera Contributor

HarithaP_0-1715858283370.png

i want to display like this in an infomessage box. when i am opening an existing incident form.how to do this.help me 

1 ACCEPTED SOLUTION

dgarad
Giga Sage

HI @HarithaP 

 try the below code.

var gr = new GlideAggregate('incident');
gr.addAggregate('COUNT','state');
gr.query();
while(gr.next()){

	gs.print("state:"+gr.state.getDisplayValue()+''+'('+gr.getAggregate('COUNT','state')+')');
}

 

dgarad_0-1715859393211.png

 

 

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

View solution in original post

2 REPLIES 2

dgarad
Giga Sage

HI @HarithaP 

 try the below code.

var gr = new GlideAggregate('incident');
gr.addAggregate('COUNT','state');
gr.query();
while(gr.next()){

	gs.print("state:"+gr.state.getDisplayValue()+''+'('+gr.getAggregate('COUNT','state')+')');
}

 

dgarad_0-1715859393211.png

 

 

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

swathisarang98
Giga Sage
Giga Sage

Hi @HarithaP ,

 

Could you please let me know every time when you open any incident form you want see  all the incident state count as an info message is it ?

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang