...
- Navigate to
System
,UI Macros
- Search by
Name
fordashboard
Open the
dashboard
UI Macro from theSquirro Service Insights
application and edit it. Overwrite the XML with the following:Code Block language xml <?xml version="1.0" encoding="utf-8" ?> <j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"> <g:evaluate> var checkRole = gs.hasRole('admin') || gs.hasRole('x_squir_si.user') || gs.hasRole('x_squir_si.admin'); if (current) { if (current.isNewRecord()) { checkRole = false; } } </g:evaluate> <j:ifchoose> <j:when test="${checkRole}"> <j:choose> <j:when test="${!empty(jvar_dashboard_id)}"> <g:evaluate var="urlRet" object="true"> var squirro = new Squirro(); var params = {}; if (current) { params.tbl = current.getRecordClassName(); params.external_id = current.sys_id; params.external_ref = current.getValue('number'); } var urlRet = squirro.generateURL('${jvar_dashboard_id}', params); urlRet; </g:evaluate> <g:breakpoint var="urlRet"/> <j:choose> <j:when test="${!urlRet.hasError}"> <style> .squirro_si_container { position: relative; padding-bottom: 918px; padding-top: 0; min-height: 880px; overflow: hidden; } .squirro_si_container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } </style> <div class="squirro_si_container"> <iframe class="squirro_si_container_iframe" width="100%" src="${urlRet.url}" frameborder="0" scrolling="0"></iframe> </div> </j:when> <j:otherwise> Error: ${urlRet.error} </j:otherwise> </j:choose> </j:when> <j:otherwise> Error: No dashboard ID specified. <j:if test="${!empty(jvar_property_description)}"> Specify the dashboard ID with the property "${jvar_property_description}" in the Squirro Properties. </j:if> </j:otherwise> </j:choose> </j:if>:when> <j:otherwise> Missing access permissions for this Squirro integration. Please make sure the UI Policy is deployed to avoid showing this error message (see the Squirro for ServiceNow administration Guide). </j:otherwise> </j:choose> </j:jelly>