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.
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.
ci_to_user_group_dynamicci_to_user_group_dynamic_minimalci_to_user_group_dynamic_fullci_to_user_group_dynamic_inlineci_to_user_group_dynamic_inline_minimalci_to_user_group_dynamic_inline_full
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.
ci_to_user_groupci_to_user_group_minimalci_to_user_group_fullci_to_user_group_inlineci_to_user_group_inline_minimalci_to_user_group_inline_full
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.
Dynamic JSON property
user_group_to_ci_dynamicuser_group_to_ci_dynamic_minimaluser_group_to_ci_dynamic_fulluser_group_to_ci_dynamic_inlineuser_group_to_ci_dynamic_inline_minimaluser_group_to_ci_dynamic_inline_full