How to show list of open incidents using UI macro in catalog item?

bbf3562
Kilo Guru

I know pretty much the only way to show list of open incidents based on assignment group that user selected in catalog item is use UI macro. Does anyone know or have example codes for that? I just want a list of open incident tickets with each of them have clickable link to go to ticket form.

1 ACCEPTED SOLUTION

Hi Frank,



The script should be updated as below and then you will get those many records.


also add log statement to print that



<g:evaluate var="jvar_gr" object="true">


gs.log('Assignment group sys id is: ' + jelly.jvar_assignmentGroup_sys_id);


  var gr = new GlideRecord("incident");


    gr.addQuery("assignment_group", jelly.jvar_assignmentGroup_sys_id); // query incident table with this assignment group


    gr.query();


    gr;


</g:evaluate>



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

7 REPLIES 7

Hi Frank,



The script should be updated as below and then you will get those many records.


also add log statement to print that



<g:evaluate var="jvar_gr" object="true">


gs.log('Assignment group sys id is: ' + jelly.jvar_assignmentGroup_sys_id);


  var gr = new GlideRecord("incident");


    gr.addQuery("assignment_group", jelly.jvar_assignmentGroup_sys_id); // query incident table with this assignment group


    gr.query();


    gr;


</g:evaluate>



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

This worked. Thanks!


Hi Frank,



Any update on this?


Can you mark my answer as correct, helpful and hit like if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.



Regards


Ankur


Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader