YouTrack InCloud 2017.2 Help

UserGroup

Extends: BaseEntity

Represents a user group.

Properties

NameTypeDescriptionRead-only
static allUsersGroup UserGroup All Users group. /help/img/youtrack/2017.2/checkbox-marked.png
static fieldType String Field type. To be used when defining rule requirements. /help/img/youtrack/2017.2/checkbox-marked.png
description String The description of the group. /help/img/youtrack/2017.2/checkbox-marked.png
isAllUsersGroup Boolean `true` in case the group is All Users group. /help/img/youtrack/2017.2/checkbox-marked.png
isAutoJoin Boolean `true` in case newly registered users are automatically added to this group. /help/img/youtrack/2017.2/checkbox-marked.png
name String The name of the group. /help/img/youtrack/2017.2/checkbox-marked.png
users Set.<User> All of the users who are members of the group. /help/img/youtrack/2017.2/checkbox-marked.png

Methods

 

findByName

static findByName(name)

Finds a group by name.

Parameters:

NameTypeDescription
name String name to find by.

Returns:

TypeDescription
UserGroup user group, or null in case no group exists with the provided name.

 

becomes

becomes(fieldName, expected)

Checks that a value a field receives in the current transaction is equal to an expected one.

Parameters:

NameTypeDescription
fieldName string name of the field to check.
expected string expected value.

Returns:

TypeDescription
boolean `true` in case the expectation is met.

 

canBeReadBy

canBeReadBy(fieldName, user)

Checks if a field can be read by a user.

Parameters:

NameTypeDescription
fieldName string name of the field.
user User to check access for.

Returns:

TypeDescription
boolean `true` in case the field can be read by the user.

 

canBeWrittenBy

canBeWrittenBy(fieldName, user)

Checks if a field can be written by a user.

Parameters:

NameTypeDescription
fieldName string name of the field.
user User to check access for.

Returns:

TypeDescription
boolean `true` in case the field can be written by the user.

 

isChanged

isChanged(fieldName)

Checks if a field is changed in the current transaction.

Parameters:

NameTypeDescription
fieldName string name of the field (e.g. 'summary') to check.

Returns:

TypeDescription
boolean `true` in case the field is changed in the current transaction.

 

notifyAllUsers

notifyAllUsers(subject, body)

Sends an email notification to all of the users who are members of the group.

issue.oldValue('permittedGroup').notifyAllUsers('Visibility has been changed', 'The visibility group for the issue ' + issue.getId() + ' has been changed to ' + permittedGroup.name);

Parameters:

NameTypeDescription
subject String The subject line of the email notification.
body String The message text of the email notification.

 

oldValue

oldValue(fieldName)

Returns the previous value of a single-valued field before an update was applied. In case the field is not changedin the transaction, this value is equal to the current value of the field.

Parameters:

NameTypeDescription
fieldName string name of the field (e.g. 'updated') to get previous value of.

Returns:

TypeDescription
Object previous value of the field.

 

required

required(fieldName, message)

Checks if a the entity has a field denoted by field name set, shows error message otherwise.

Parameters:

NameTypeDescription
fieldName string name of the field to check.
message string message to show in case the field is not set.

 

Last modified: 9 August 2017