Artefact Query JSON Definition

This part describes how to build the JSON body request for API request : POST /artefacts/{artefact-id}/query.

First level Attributes

  • artefactTypes (optional, default: any) JSON array of artefact types to filter on.

  • linkType allows to filter artefacts linked to the current artefact according to their link type. For more information about links, refer to Artefact Links.

  • linkDirection (optional, default: OUT) is used to specify the link direction to consider. Accepted values are:

    • OUT to consider links from the current artefact towards other artefacts

    • IN to consider links from other artefacts towards the current artefact

  • columns (mandatory) JSON array of column object.

  • orders (optional) JSON array of order object.

  • filters (optional) JSON array of filter object.

  • resultSize (optional, default: all) is the number of returning items.

  • hidePath (optional, default: false) is the flag to hide the path.

  • hideRating (optional, default: false) is the flag to hide the rating.

Columns Attributes

The column object is used to add a column to the list of artefacts returned.

  • type (mandatory) define the type of the column. The possible values are MEASURE, INDICATOR or INFO.

  • id (mandatory) is the ID of the measure, indicator or textual information to display.

  • displayType (optional, only for indicator type, default: NAME) is the label to display in the header. The supported values are:

    • RANK for the indicator’s rank

    • ICON for the indicator’s rank icon

    • NAME for the indicator level’s name

    • MNEMONIC for the indicator level’s mnemonic

  • useBackgroundColor(optional, default: false) allows you to use the indicator level as the background colour of the cell. This is only valid when using a column with indicatorId. You can also control the transparency of the background colour with the attribute. Only for indicator type.

  • alpha (optional, default: 100) alpha which accepts a value between 0 (transparent) and 255 (opaque). Only when useBackgroundColor is used.

  • excludingTypes (optional, default: none) lists the artefact types for which the metric should not be displayed. This allows refining the types provided in the main filter above.

Orders Attributes

The order object is used to specify sorting directives.

  • type (mandatory) define the measure type. The possible values are ROOT_MEASURE or MEASURE.

  • id (mandatory) is the ID of the measure

  • order (mandatory) is the sort order for measure. Supported values are:

    • ASC for ascending

    • DESC for descending

  • orderType (mandatory) define the sorted value for the measure. Supported values are:

    • VALUE is the value of the measure

    • RANK is the rank of the measure

    • DIFF_VALUE is the difference between values

    • DIFF_RANK is the difference between ranks

Filters Attributes

The filter object is used to specify extra filtering conditions for the artefacts to return.

  • type (mandatory) define the type of the column. The possible values are measure, indicator or info.

  • id (mandatory) is the ID of the measure, indicator or textual information to return.

  • data (mandatory) JSON Object that contains fields :

    • checked (optional,default: ?) is the values of the measure/indicator/info you want to return. (or not if invert is equals to True)

    • bounds (optional,only for indicators and measures types, default: [;[) is the value limits. Infinite bounds can be specified by omitting the number, e.g.: [0;[ or [0;] for any null or positive number.

    • patterns (optional,only for info types, default: *) is the value patterns of the data you want to return. The available patterns are:

      • * Matches any sequence of characters in string, including a null string.

      • ? Matches any single character in string.

  • invert (optional, default: false) allows to invert the condition.

For the filter info type, you can’t use the fields 'patterns' and 'checked' together. The checked field has priority.

Query definition example

{
	"artefactTypes": ["MODULES"],
	"linkType": "IMPLEMENTATION",
	"linkDirection": "IN",
	"hideRating": true,
	"columns": [{
			"type": "INDICATOR",
			"id": "CPXT",
			"displayType": "ICON",
			"useBackgroundColor": false
		}, {
			"type": "MEASURE",
			"id": "VG"
		}, {
			"type": "MEASURE",
			"id": "NEST"
		}, {
			"type": "MEASURE",
			"id": "NPAT"
		}, {
			"type": "MEASURE",
			"id": "STAT"
		}, {
			"type": "MEASURE",
			"id": "NOP"
		}, {
			"type": "MEASURE",
			"id": "DOPD"
		}, {
			"type": "MEASURE",
			"id": "VOCF"
		}
	],
	"orders": [{
			"type": "MEASURE",
			"id": "CPXT",
			"order": "DESC",
			"orderType": "VALUE"
		}, {
			"type": "MEASURE",
			"id": "VG",
			"order": "ASC",
			"orderType": "VALUE"
		}
	],
	"filters": [{
			"type": "measure",
			"id": "CPXT",
			"data": {
				"bounds": ["[0.0;["]
			}
		}
	]
}