Use > Service Manager Reports > My reports > Build the query strings

Build the query strings

You can use query filters to define the report content logic when you create a report. This topic provides specifications to explain how to configure the strings for the query parameter when you create a report. The query display field is read-only, and you can use the query builder to define the condition for the report. HPE Service Manager also supports cross-table queries.

Note If you want to use query filters in a duration or calculation report for a user who is not the report owner, you must run the report in the frontend (to do this, select the Run in Frontend option). Reports run in the background will always use the report owner's information to populate the query parameters.

Note that reports run in the frontend typically take longer to execute, as the data is not prepared and cached in the backend.

HPE Service Manager provides the following types of query parameters.

Query type Sample Procedure
Simple query Open incident backlog group by priority

Click Query Builder to fill in the requirements for the query results. You can edit the filter fields and check the check box to specify the required conditions. Click OK to generate the query strings directly in the query display field.

Cross-table query Open incident group by affected CI

Click Query Builder and select Advanced Filter to specify the query conditions. For more information about how to use advanced filter, see Advanced filter and other related topics.

Note All relationships between tables are stored in relatedObjectMap.

Advanced Query Support variables All incidents assigned to my group

Select one assignment group. The query will be generated automatically, and then you can change the query to use the variables.

assignment isin $lo.pm.assignments

Support JSCall incident for falcon

function getDefaultComp(){return "falcon";}

assignee.name =jscall("test.getDefaultComp")

Support RTE function All incident assigned to me assignee.name = operator()
Support new method startofyear, startofmonth, and startofweek

startofweek() returns the first day of the current week

startofweek(startofweek() - 1) returns the first day of the last week

After you enter a query string, you can click Test Query to validate the query. A new message pops up, displaying the diagnostic information for this query string.

  • When you enter 1=1 condition, Service Manager displays the following message:

    Current search criteria is equal to "(1=1)", full table query would be needed.

  • When the field is CLOB/BLOB, Service Manager displays the following message:

    Partial File Scan might be needed since field "action" (on file probsummary) is mapped to BLOB/CLOB/TEXT/IMAGE [Description field in cm3r]

  • When the field is not indexed, Service Manager displays the following message:

    There is no index defined in dbdict for field "sysmodtime" (on file kmfeedback). [sysmodtime in kmfeedback]