Skip to main content

Teams (cmdb_rel_team)

The Teams related list associates a user group to a CI based on group type, providing flexibility in tracking the different types of groups assigned to a CI. The Teams related list appears on CI forms for CIs of the Service cmdb_ci_service class and its descendent classes such as the Application Service cmdb_ci_service_auto class.

Source: ServiceNow - Teams related list

squid by arc46 ships with the following predefined M-to-N Relations that may be used to retrieve these relations.

Usage: Add the required relation configuration name to the query parameter relations.

Example: https://demo.squid46.io/cmdb_ci_server_inline_minimal?encodedQuery=base_name=dbaix901nyc&relations=ci_to_user_group_dynamic_inline_minimal

info

cmdb_rel_team only links to cmdb_ci classes. These relation configurations therefore only make sense if your base request is for a class that extends cmdb_ci. You won't get an error if not, but you won't get any matches either.

CI to User Group

Dynamic JSON property

'*dynamic' configurations use the value of the group_type property to determine the JSON property as which the relation should be rendered.

Try it out. The below links will open a new tab with live request for the relation configuration.

Example:

{
"metadata": {
...,
"requested_relations": {
"cmdb_ci_server_minimal": [
"ci_to_user_group_dynamic_minimal"
]
}
},
"data": [
{
"name": "dbaix901nyc",
"sys_class_name": "cmdb_ci_unix_server",
"sys_id": "5f9b83bfc0a8010e005a2b3212c9dc07"
}
],
"relations": {
"5f9b83bfc0a8010e005a2b3212c9dc07": {
// dynamically determined JSON property
"managed_by": [
{
"sys_id": "6577e5908f972410960c53ac37bdee66",
"sys_class_name": "sys_user_group"
}
],
// dynamically determined JSON property
"approval": [
{
"sys_id": "b85d44954a3623120004689b2d5dd60a",
"sys_class_name": "sys_user_group"
}
]
}
},
"referenced": {
"6577e5908f972410960c53ac37bdee66": {
"name": "Infrastructure",
"sys_id": "6577e5908f972410960c53ac37bdee66"
},
"b85d44954a3623120004689b2d5dd60a": {
"name": "CAB Approval",
"sys_id": "b85d44954a3623120004689b2d5dd60a"
}
}
}

Currently, the caller cannot restrict what group_types are returned.

An squid by arc46 admin may however create a custom relation configuration that utilizes the dynamic aspect of these configurations.

Let's assume you have defined three group_type values (support_1, support_2, support_3) that represent your support level groups. A relation configuration with e.g. query = group_typeSTARTSWITHsupport would return all relations with a matching group_type and dynamically render them as

{
"metadata": {
...,
"requested_relations": {
"cmdb_ci_server_minimal": [
"ci_to_user_group_dynamic_support"
]
}
},
"data": [
{
"name": "dbaix901nyc",
"sys_class_name": "cmdb_ci_unix_server",
"sys_id": "5f9b83bfc0a8010e005a2b3212c9dc07"
}
],
"relations": {
"5f9b83bfc0a8010e005a2b3212c9dc07": {
// dynamically determined JSON property
"support_1": [
{
"sys_id": "6577e5908f972410960c53ac37bdee66",
"sys_class_name": "sys_user_group"
}
],
// dynamically determined JSON property
"support_2": [
{
"sys_id": "b85d44954a3623120004689b2d5dd60a",
"sys_class_name": "sys_user_group"
}
]
}
},
"referenced": {
...
}

See Custom M-to-N Tables on how you can create your own M-to-N Relations.

"user_groups" JSON property

The below-mentioned CI to User Group relations are borderline useless. Read on to see why and why we're still including them.

Try it out. The below links will open a new tab with live request for the relation configuration.

These relations do not include the group_type (Default choice values: approval, change, managed_by, support).

All referenced sys_user_groups are rendered as JSON property user_groups. This as such will often be borderline useless, as the relevant information is the group_type. As the group_type is neither a property of the referencing cmdb_ci nor of the referenced sys_user_group this information is lost. We have nonetheless included all configuration variants as templates for custom configurations. See below.

Example:

{
"metadata": {
...,
"requested_relations": {
"cmdb_ci_server_minimal": [
"ci_to_user_group_minimal"
]
}
},
"data": [
{
"name": "dbaix901nyc",
"sys_class_name": "cmdb_ci_unix_server",
"sys_id": "5f9b83bfc0a8010e005a2b3212c9dc07"
}
],
"relations": {
"5f9b83bfc0a8010e005a2b3212c9dc07": {
"user_groups": [
{
"sys_id": "6577e5908f972410960c53ac37bdee66",
"sys_class_name": "sys_user_group"
},
{
"sys_id": "b85d44954a3623120004689b2d5dd60a",
"sys_class_name": "sys_user_group"
}
]
}
},
"referenced": {
"6577e5908f972410960c53ac37bdee66": {
"name": "Infrastructure",
"sys_id": "6577e5908f972410960c53ac37bdee66"
},
"b85d44954a3623120004689b2d5dd60a": {
"name": "CAB Approval",
"sys_id": "b85d44954a3623120004689b2d5dd60a"
}
}
}

How to make this type of relation config useful

Short version (WIP): In the relation configuration set a query e.g. group_type=change and defined the JSON property as e.g. change_group. You would then get

a) only the sys_user_groups of group_type change and
b) have those sys_user_groups placed under a JSON property of your choice (change_group).

See Custom M-to-N Tables on how you can create your own M-to-N Relations.

User Group to CI

WIP. If you're reading this before we get around to documenting it:

This is basically just the reversal of the above.

squid by arc46 ships with the following predefined M-to-N Relations that may be used to retrieve these relations.

Usage: Add the required relation configuration name to the query parameter relations.

Example: https://demo.squid46.io/sys_user_group_inline_minimal?encodedQuery=base_name=CAB%20Approval&relations=user_group_to_ci_dynamic_inline_minimal

Dynamic JSON property

"user_groups" JSON property