YouTrack Standalone 2017.1 Help

Projects

Project Properties

Project properties that return a sequence type have a set of extended properties that are available for all sequence types. There is also a method you can use to find a specific element in the sequence. For more information, see Sequence-related Methods.

The following properties are available for projects. These properties are read-only..

PropertyDescriptionState
shortName: stringThe project ID. For example, YTF is the project ID for the YouTrack Feedback project.Read-only
name: stringThe project name. For example, YouTrack Feedback.Read-only
description: stringThe project description. Returns a null value when empty.Read-only
createdBy: UserThe user who created the project.Read-only
leader: UserThe project leader.Read-only
issues: sequence<Issues>A sequence of issues that belong to the project.Read-only
fields: sequence<projectFields>A sequence of project fields. See below for details.Read-only

Project-related Methods

The following methods are available for use with projects. See also Project Properties.

getUser

SyntaxgetUser(login: string): user
ParametersloginThe username of the user.
DescriptionReturns a user by login. If no such user exists, a null value is returned.
Example
if (created < 2012-12-31 && !isResolved()) { tags.add(project.getUser("root").getSharedTag("obsolete?")); }

isArchived

SyntaxisArchived(): Boolean
DescriptionChecks the current status of a project.
Example
when Assignee.changed { for each subtask in parent for { if (subtask.project.isArchived()) { continue; } if (subtask.Assignee == Assignee.oldValue) { subtask.Assignee = Assignee; } } }

Project-related Operations

The following operations are available for projects.

becomes

Syntaxbecomes(value: [field]): Boolean
ParametersvalueThe value to check for the specified field.
DescriptionChecks 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

SyntaxcanBeReadBy(user: user): Boolean
ParametersuserThe user for whom the permission to read the field is checked.
DescriptionChecks whether a specific user has permission to read the custom field.

canBeWrittenBy

SyntaxcanBeWrittenBy(user: user): Boolean
ParametersuserThe user for whom the permission to update the field is checked.
DescriptionChecks 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

Syntaxchanged(): Boolean
DescriptionChecks whether a the value of the custom field is changed in the current transaction.
Example

oldValue

SyntaxoldValue(): [field type]
DescriptionReturns 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

Syntaxrequired(message: string)
ParametersmessageThe message that is displayed to the user that describes the field requirement.
DescriptionAsserts 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"); }

valuesFor

SyntaxvaluesFor(field: custom field): sequence of field types
ParametersfieldThe name of the custom field for which values are returned.
DescriptionReturns a read-only sequence of values that are used by the custom field in this project.
Example
when parent for.added.isNotEmpty { for each subtask in parent for.added { if (project != subtask.project && issue.project.valuesFor(Fix versions).first != subtask.project.valuesFor(Fix versions).first) { continue; } if (!subtask.isResolved()) { subtask.Fix versions.clear; for each version in Fix versions { subtask.Fix versions.add(version); } } } }
Last modified: 18 April 2017