QPR Knowledge Base 2017.1

Common Query Functions

Common Query Functions

Previous topic Next topic No directory for this topic  

Common Query Functions

Previous topic Next topic Topic directory requires JavaScript Mail us feedback on this topic!  

These functions are available for all objects (UM, PO, PG, and SC):

 

Related([relation=<relation name> [, <relation parameters>]], [hierarchy=<hierarchy name> [, <hierarchy parameters>]], <recursion parameters>, <global parameters>])

Returns related objects identified by <relation name> or <hierarchy name>.

 

SubObjects([<recursion parameters>, <global parameters>])

Returns all sub-objects.

 

HierarchyRoots(hierarchy=<hierarchy name> [, <hierarchy parameters>] [, <global parameters>])

Returns root nodes of a given hierarchy.

 

Filter([include=<typename(s)>, exclude=<typename(s)>, responsible=<userid(s)>, <global parameters>])

Filters objects by leaving only objects of given types and (in the case user ID is provided) objects which the corresponding user is responsible for. Model ID's and product ID's are not supported. All objects that do not support responsibility status are filtered out in the case the responsible parameter is defined. Note that if an attribute that takes parameters (e.g. period for a range value) is used in a filter, the parameter value needs to be enclosed in escaped parentheses, e.g. \"SC.123456789.234567890\".

Actions([<recursion parameters>, <global parameters>])

Returns actions connected to an object. Not available for full ID's containing only the product ID. If called for a model, all the actions attached to any object in that model are returned. If versioning is used in PG, this function always returns actions attached to any version (i.e. actions are queried from the root model).

 

<typename>([<recursion parameters>, <global parameters>])

Returns related objects of type <typename>. If the type name in the product contains spaces, omit them when using them here.

 

<relationname>([<relation parameters>, <recursion parameters>, <global parameters>])

Returns objects related through <relationname>.

 

<hierarchy name>([<hierarchy parameters>, <recursion parameters>, <global parameters>])

Returns objects next in hierarchy identified by <hierarchy name>. Unless recursion parameters define otherwise, only the first level of the defined hierarchy is returned.

 

attributeasfunction(attributeasfunction="<attributename>")

This relation allows any object query attribute to be used as an object query relation. For example [PO].comment.attributeasfunction(attributeasfunction="creator") would return IDs of all users who have created Comment type actions.

 

Parameter Group Values

The parameter group values listed in angle brackets in the function listings above are as follows:

 

<typename>

Valid options for the UM object: See the UM Object Functions section.

Valid options for the PO object: See the PO Object Functions section.

Valid options for the PG object: See the PG Object Functions section.

Valid options for the SC object: See the SC Object Functions section.

 

<typename(s)>

A comma-separated list of multiple <typename> parameters.

<userid(s)>

A comma-separated list of user ID's, login names, or a set of user ID's. _CURRENT_USER is used to identify the current user.