Skip to main content

Add a Custom Query to Master Data Type

  1. Open the Configuration Editor for your RISKSHEET document
  2. Navigate to the Data Types section
  3. Locate the master (or primary risk item) data type configuration
  4. Add or modify the query property:
"dataTypes": {
  "master": {
    "type": "fmearisk",
    "query": "status:(open OR in_progress)"
  }
}
  1. Save the configuration
RISKSHEET uses Lucene query syntax. Common patterns:
  • Field matching: fieldName:value
  • OR conditions: (value1 OR value2)
  • AND conditions: field1:value1 AND field2:value2
  • Wildcards: title:*safety*

Filter by Custom Field Values

To filter work items based on custom field values, reference the custom field ID in your query:
"query": "customFields.severity:(high OR critical)"
For document-level custom fields, use SQL syntax when simple property queries fail:
SELECT WI.C_PK 
FROM WORKITEM WI
INNER JOIN MODULE M ON WI.C_MODULE_FK = M.C_PK
INNER JOIN CF_MODULE CFM ON M.C_PK = CFM.C_FK
WHERE CFM.C_KEY = 'productLine' AND CFM.C_VALUE = 'Automotive'
Standard Lucene queries cannot directly filter by document-level custom fields. For complex document-level filtering, consider consolidating multiple RISKSHEETs into a single view with many-to-many relationships rather than using cross-document queries.

Filter by Multiple Work Item Types

Combine type filters with OR logic to include multiple work item types:
"dataTypes": {
  "master": {
    "type": "fmearisk hararisk",
    "query": "severity:high"
  }
}
The system automatically adds the type filter and combines it with your custom query using AND logic.

Query Decision Matrix

ScenarioRecommended ApproachExample
Filter by work item statusSimple Lucene querystatus:(open OR in_progress)
Filter by custom fieldLucene with customFields prefixcustomFields.priority:high
Filter by document custom fieldSQL query or architecture redesignUse many-to-many consolidation
Filter by multiple typesSpace-separated types + querytype: "risk hazard" + query
Dynamic filtering by row contextUse Query Factory insteadSee Use Query Factory

Query Execution Flow

diagram

Common Pitfalls

Empty or whitespace-only queries are ignored. If you want to load all work items of the specified type, omit the query property entirely rather than setting it to an empty string.
Document IDs with the _default/ prefix (default modules) have the prefix automatically stripped in queries. If your query references document IDs directly, account for this behavior.

Verification

After configuring your query:
  1. Reload the RISKSHEET document
  2. Open the browser developer console (F12)
  3. Check the Network tab for the work item query request
  4. Verify that only expected work items appear in the grid
You should now see only work items matching your custom query criteria displayed in the RISKSHEET.

See Also

Support TicketsSource Code
  • QueryBuilder.java
  • SuggestionServlet.java
  • MultiItemLinkEditor.ts
  • RisksheetViewServlet.java
  • TextEditor.ts