Servicely Capability
Reports and Dashboards
Reports
17 min
a report provides visibility of a particular dataset that can be visually presented in different ways depending on the target audience and outcome it can be restricted to different users with different servicely system roles or groups, can be scheduled and can also be placed onto dashboards creating a report to create a report, navigate to reporting > reports > new report the following shows the navigation menu selections you may see as an administrator once there, populate the following fields field name description example name name of the report active slas by groups description provides more description of the report report on active slas by groups title title of the report that will be displayed when viewed on a dashboard active slas by groups primary table tab primary table servicely table the report will run on incident primary query used to filter the data from the selected primary table, that will be used for the report closed = false secondary table tab use secondary table if you want to join a table with the primary one example, grouping slas by associated incident’s assignment group will require report running on two tables, incident and sla if set to yes, the rest of the fields in this tab will appear yes secondary table servicely table the report will also run on, will be joined to the primary table yes secondary query used to filter the data from the selected secondary table, that will be used for the report active = true primary join field field from primary table whose value will need to match value on the “secondary join field” below id secondary join field field from secondary table whose value will need to match value on the “primary join field” above parent grouping and aggregation use group by from primary table if set to yes, the “primary group by” field will appear, otherwise the “secondary group by” field will appear yes primary group by field from primary table to group the results by assignment group secondary group by field from secondary table to group the results by group by full range applicable for choice/boolean field as the group by field when set to yes, the report will display all options the field has regardless if there is any record returned with such choice / boolean value use stack by from primary table if set to yes, the “primary stack by” field will appear, otherwise the “secondary stack by” field will appear yes primary stack by field from primary table to stack the results by priority secondary stack by field from secondary table to stack the results by stack by full range applicable for choice/boolean field as the stack by field when set to yes, the report will display all options the field has regardless if there is any record returned with such choice / boolean value use aggregation field from primary table if set to yes, the “primary aggregation field” field will appear, otherwise the “secondary aggregation field” field will appear primary aggregation field field from primary table to aggregate the results by secondary aggregation field field from secondary table to aggregate the results by aggregation type how we are aggregating the result duration type applicable only if the aggregation field is a duration field decimal places number of decimal places to round if the aggregation field is a duration field period type period to apply group by or stack by if the field type is either date or date/time record limit maximum number of records returned please consider this when running reports against large dataset as this will help with report performance aggregation order by order aggregated result of the report disable drill down to use this functionality, you need to be on version 1 10 or later this prevents users from being able to drill down on this report and see the records behind the report by disabling drill down, the report will load faster no appearance template category type of report to render column template template or rendering variation of the report type note that you can also create your own and modify as required please refer to advanced function section for examples column stacked theme provides styling for the selected template note that this is optional and you can also create your own and modify as required dark effects type provides extra styling effect note that this is also optional 3d post processing if set to yes, the configuration script field will appear configuration script that can be used to configure the highcharts options generated from the template and theme the options are available as the variable 'options' please refer to advance function section below for examples security private if set to yes, will restrict the report from being visible to anyone but the creator or system administrators if set to no, will make the report available to everyone including on dashboards assuming the other criteria below are met roles restricts the report to anyone with the specified servicely roles groups restricts the report to anyone that is a member of the specified servicely groups entitlement script allows for more complex (scripted) restrictions on who can view the dashboard visibility restrictions a report’s visibility can be restricted by a combination of private private = “no” means the report is visible to other users assuming the other criteria below are met roles servicely system roles that logged on user must have before they are allowed to view the report groups servicely groups that logged on user must be part of before they are allowed to view the report entitlement script allows for more complex restrictions on who can view the report please note that the visibility restriction/security of a report applies only to the report itself it does not apply to the underlying table and records that report is configured to show taking an example of a report for incident table, not only your report’s intended audience need to be able to view the report but they also need to have the permissions required to view the incident table and records shown in the report if a user is allowed to view a report but they do not have the permission to view the table/records the report is showing, then they will see a blank report administrative roles the following are the different system roles applicable to reports role description administrator can create reportscan view and edit all public and private reports can read/edit script fields on reports such as the entitlement script report editor can create reportscan view and edit all public reports and also the private ones that they had created can make their own private reports to be public platform agent can create reportscan view and edit all public report and also the private ones that they had created advanced functions knowledge of both javascript and json is essential for configuration outlined in this section report debugging to find out the options passed to the reporting engine, for any given report, please ensure that you enable “report debugging information” via your user’s setting once enabled, view the report you want and it will return the json structure of the options that you can alter as outlined in the proceeding section of this article post processing reports that servicely generates can be further processed to tweak its appearances, such as around its labels, data it displays and groupings to do that set post processing flag to be “yes” write the required script in the “configuration” script field note that you will find similarities to a report template in terms of what you can configure, but in a slightly different syntax/format it is recommended to use this in conjunction with the report debugging option switched on the debugger is also aimed to make it easier to determine where you need to make changes, in the generated json object for a report, to achieve the outcome you need example 1 changing a number report to have $ prefix and decimal value to represent more accurate aggregate count original report view configuration script applied options servicely before = function( , hc) { hc setoptions({ lang { decimalpoint ' ', thousandssep ',' } }); }; //options series\[0] data\[0] y = 123456789 56; options plotoptions series datalabels format = '${point y , 2f}'; options; after the configuration script is applied example 2 adding label on top of individual columns of a grouped column chart original report view post processing script applied let datalabelstyling = { "fontfamily" "\\"source sans pro\\", helvetica, sans serif", "color" "#495674", "fontsize" "13px", "fontweight" "500", "fontstyle" "normal" } options plotoptions column datalabels = {}; options plotoptions column datalabels style = datalabelstyling; options plotoptions column datalabels enabled = true; options; after the post processing script was applied example 3 adding percentage and count to label of each grouping in a pie chart original report view post processing script applied // 1 append total counts to the data labels let totalcount = 0; if (options series length > 0) { // 1 a get total count first by going through each grouping's value and tally them up options series\[0] data foreach( elem => totalcount += elem y); // 1 b go through the list again, to calculate percentage and append to the data labels options series\[0] data foreach( elem => { let percentage = math round(( elem y / totalcount) 1000) / 10; elem name = elem name + " " + percentage + "\\% (" + elem y tostring() + ")"; }); } options; after the post processing script was applied example 4 aggregating total open tickets across multiple tables report will by default return total counts per individual table for example if you are reporting off work or itsmwork table, the total counts will be spread across individual child tables original report view on itsmwork post processing script applied let seriesdata = options series\[0] data; let grandtotal = 0; let allrecordidsarr = \[]; // 1 get grand total seriesdata foreach(function( elem) { grandtotal += elem y; allrecordidsarr = allrecordidsarr concat( elem ddids); }); let newdataset = \[]; newdataset push(seriesdata\[0]); newdataset\[0] y = grandtotal; newdataset\[0] ddids = allrecordidsarr; options series\[0] data = newdataset; options; after the post processing script was applied example 5 always show the table underneath the chart with the numbers post processing script applied options servicely before = function( , hc) { hc setoptions({ }); }; options exporting = {}; options exporting showtable = true options; example 6 changing data label to be more intuitive for certain reports, you may need the reports to show the labels in a more intuitive way e g if you are reporting on slas grouped by their “slamet” flag, format wise, you will get something similar to the following but you can apply post processing script for the data label to be more meaningful, for example, “sla met” when slamet field = true and “sla breached” when slamet field = false; post processing script applied if (options series length > 0) { options series\[0] data foreach( elem => { if ( elem name == "true") { elem name = "sla met"; } else if ( elem name == "false") { elem name = "sla breached"; } }); } options; after post processing script is applied template this field is located under a report definition’s appearance tab it references the “report template” table where you can create your own by navigating to reporting > reports > all report templates the following are the fields on the report template form field name description example name name of the report template this is the name that will appear on the report definition form when you are picking a template other custom number with label category this report template will appear under this category on a report definition form other description more details about the report template default if set to yes, this will be the template used if a report isn’t configured to use one no template the options that will be used for the report template you may refer to existing out of box templates for examples if you are creating your own, please consider copying off an existing template that is closest to what you need and then modify accordingly example 1 changing a number report template to have $ prefix and decimal value to represent more accurate aggregate count original report view modify the “servicely” option to be servicely { before function(report, highcharts) { report singledatapointaggregation(this); highcharts setoptions({ lang { decimalpoint ' ', thousandssep ',' } }); } } then, modify the plotoptions to have its series' datalabels' format to be plotoptions { series { datalabels { format '${point y , 2f}', }, } after the configuration script is applied