Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This makes use of a Squirro-provided UI Macro (x_squir_si_dashboard) to simplify the integration. Replace the DASHBOARD_ID value with the dashboard's identifier.

Known Issues

Dashboard always loaded

The current version 1.0.0 of Squirro for ServiceNow loads the Squirro dashboards even when the corresponding roles have not been assigned to a user. This is because the UI Policy is applied on the client side, and thus too late to prevent the embedded dashboard from loading. While a full fix is being prepared by Squirro, you can prevent this from happening by changing the default Squirro dashboard UI Macro.

  1. Navigate to SystemUI Macros
  2. Search by Name for dashboard
  3. Open the dashboard UI Macro from the Squirro Service Insights application and edit it. Overwrite the XML with the following:

    Code Block
    languagexml
    <?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:if 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>
    </j:jelly>