UserGroups
Properties
The following properties of a group can be accessed with a workflow. These properties are read-only.
See also Group-related Methods.
Property | Description |
---|
name: string | The name of a group. |
description: string | The description of a group.
Returns a null value if a description has not been set for the group. |
addNewUser: Boolean | True if new users are added to this group automatically. |
allUsersGroup: Boolean | True if this is the All Users group. |
Methods
The following methods are available for use with groups.
getUsers(): sequence<User> |
---|
Description | Returns all of the users who are members of the specified group. |
Example | var users = Assignees group.getUsers();
|
notifyAllUsers(subject: string, body: string) |
---|
Parameters | subject | The subject line of the email notification. |
body | The message text of the email notification. |
Description | Sends an email notification to all of the users who are members of the group. |
Example | permittedGroup.oldValue.notifyAllUsers("Visibility has been changed",
"The visibility group for the issue "
+ "<a href=\"" + issue.getUrl() + "\">" + issue.getId()
+ "</a> has been changed to " + permittedGroup.name);
|
Operations
The following operations are available for groups.
becomes(value: [field]): Boolean |
---|
Parameters | value | The value to check for the specified field. |
Description | Checks whether a specific value is set for a custom field in the current transaction. |
Example | when State == {Verified} && !State.becomes({Verified}) {
assert comments.added.isEmpty: l10n ( Commenting for fixed and verified issues is disabled. );
}
|
canBeReadBy(user: user): Boolean |
---|
Parameters | user | The user for whom the permission to read the field is checked. |
Description | Checks whether a specific user has permission to read the custom field. |
canBeWrittenBy(user: user): Boolean |
---|
Parameters | user | The user for whom the permission to update the field is checked. |
Description | Checks whether a specific user has permission to update the custom field. |
Example | when duplicates.added.isNotEmpty && State != {Duplicate} {
if (State.canBeWrittenBy(loggedInUser)) {
State = {Duplicate};
}
}
|
changed(): Boolean |
---|
Description | Checks whether a the value of the custom field is changed in the current transaction. |
Example |
|
oldValue(): [field type] |
---|
Description | Returns the previous value of the specified custom field before an update was applied. |
Example | when State == {Verified} && !State.becomes({Verified}) {
assert comments.added.isEmpty: l10n ( Commenting for fixed and verified issues is disabled. );
}
|
required(message: string) |
---|
Parameters | message | The message that is displayed to the user that describes the field requirement. |
Description | Asserts that a value is set for a custom field.
Can also be used for link types.
If a value for the required field is not set, the field is highlighted in the issue and the specified message is displayed. |
Example | state Approved {
enter {
Assignee.required("Please select an assignee");
}
|
Last modified: 18 April 2017