Developer Portal for YouTrack and Hub Help

Operations with a Specific Subgroup of a Group

This resource lets you work with a specific subgroup in Hub and YouTrack.

Resource

<Hub Service URL>/api/rest/usergroups/{groupID}/subgroups/{subgroupID}

Returned entity

UserGroup. For the description of the entity attributes, see UserGroup Attributes.

Supported methods

Group Attributes

Represents a group in Hub and YouTrack.

Attributes

This table describes attributes of the UserGroup entity.

  • To receive an attribute in the response from the server, specify it explicitly in the fields request parameter.

  • To update an attribute, provide it in the body of a POST request.

Field

Type

Description

id

String

The unique identifier of the group. Read-only.

aliases

Set.<alias>

The set of IDs of user groups that have been merged into this group.

allUsers

Boolean

true if this is the All Users group. This is a special unique group that always includes all user accounts in the system.

autoJoin

Boolean

Determines whether new users are added to this group automatically.

autoJoinDomain

String

Stores an optional email domain used for auto-joining users to this group. If the user's email belongs to this domain, they are added to this group automatically.

description

String

The description of the group.

iconUrl

String

The URL of the icon of the group.

name

String

The name of the group.

organizations

Set.<organization>

The list of organizations that this group belongs to.

ownUsers

Set.<user>

The list of users that belong to this group directly.

parent

userGroup

The parent group that this group belongs to.

project

Set.<project>

The list of projects in which the group is used as a resource.

projectRoles

Set.<projectRole>

The list of project roles assigned to the users of this group.

subgroups

Set.<userGroup>

The list of groups that belong to this group as sub-groups.

userCount

Integer

The number of users that belong to the group.

users

Set.<user>

The list of all users that belong to this group.

Read a Specific Subgroup

Get a specific subgroup of a parent group.

Request Syntax

GET <Hub Service URL>/api/rest/usergroups/{groupID}/subgroups/{subgroupID}?{fields}

Request Parameters

Parameter

Type

Description

fields

String

Optional. Returns only the specified subset of the fields for each group. Use Fields Syntax to define the subset.

Sample

Request

https://example.youtrack.cloud/hub/api/rest/usergroups/4fg27fe4-f780-4a61-9eff-2fe797b9b9f4/subgroups/55deb51a-8184-4777-921a-cc3037e15285?fields=id,name,users(login),projectRoles(project(name),role(name))

Response Body

{ "type": "userGroup", "id": "55deb51a-8184-4777-921a-cc3037e15285_team", "name": "Monitoring Staff", "projectRoles": [ { "type": "projectRole", "role": { "name": "Contributor", "immutable": false }, "project": { "name": "Monitoring" } } ], "users": [ { "type": "user", "login": "minnie.terry" }, { "type": "user", "login": "william.johnson" }, { "type": "user", "login": "angelique.lovell" } ] }

Update a Specific Group

Update a subgroup.

Request Syntax

POST <Hub Service URL>/api/rest/usergroups/{groupID}/subgroups/{subgroupID}?fields=string

Request Parameters

Parameter

Type

Description

fields

String

A list of UserGroup attributes that should be returned in the response. If no field is specified, only the entityID is returned.

Sample

In this example, we update the name of a subgroup.

Request

https://example.youtrack.cloud/hub/api/rest/usergroups/4ff27fe4-f780-4a61-9eff-2fe797b9b9f4/subgroups/9eс6d2e0-fa56-4765-92e1-3b6d7b4c81b8?fields=id,name,users(login),projectRoles(project(name),role(name))

Request Body

{ "name": "Monitoring Stuff" }

Response Body

{ "type": "userGroup", "id": "9eс6d2e0-fa56-4765-92e1-3b6d7b4c81b8", "name": "Monitoring Staff", "projectRoles": [ { "type": "projectRole", "role": { "name": "Contributor", "immutable": false }, "project": { "name": "Frontend &amp; UX" } } ] }

Remove a Specific Group

Remove a group from the list of subgroups of a group.

Request Syntax

DELETE <Hub Service URL>/api/rest/usergroups/{groupID}/subgroups/{subgroupID}

Sample

Request

https://example.youtrack.cloud/hub/api/rest/usergroups/4ff27fe4-f780-4a61-9eff-2fe797b9b9f4/subgroups/9d4d19df-755d-4bc0-84fe-675d79e8c49a
Last modified: 8 February 2024