- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2018 08:10 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2018 07:03 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2018 01:12 AM
Hi Frank,
have following code in UI Page of catalog item
UI Page Code:
Name of ui page: incident_show
HTML Section:
<?xml version="1.0" encoding="UTF-8"?>
<j:jelly trim="false" xmlns:g="glide" xmlns:g2="null" xmlns:j="jelly:core"
xmlns:j2="null">
<j:set var="jvar_assignmentGroup_sys_id" value="${RP.getWindowProperties().get('assignmentGroupSysId')}" />
<g:evaluate var="jvar_gr" object="true">
var gr = new GlideRecord("incident");
gr.addQuery("assignment_group", ${jvar_assignmentGroup_sys_id}); // query incident table with this assignment group
gr.query();
gr;
</g:evaluate>
<j:while test="${jvar_gr.next()}">
<tr>
<td><a href="incident.do?sys_id=${jvar_gr.getValue('sys_id')}">${jvar_gr.getValue('number')}</a></td>
</tr>
</j:while>
</j:jelly>
Call this UI page on change of assignment group field on catalog item.
var dialog = new GlideDialogWindow("incident_show");
dialog.setTitle("Incident Details");
dialog.setPreference("assignmentGroupSysId", g_form.getValue('assignment_group')); // use variable name here
dialog.render();
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2018 05:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2018 05:59 AM
Hi Frank,
As mentioned in my comment I have created UI page and not UI macro.
Can you test it with UI page
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2018 06:09 AM