YouTrack Standalone 7.0 Help

Fields

In the workflow programming language, a field is

The properties and methods listed on this page reference values that are stored in custom fields, and the field definitions in a project.

Custom Field Properties

The following properties refer to custom fields and the values that are stored in a custom field. See also Field-related Methods.

The following properties are read-only.

PropertyDescription
name: StringThe name of the custom field.
description: StringThe description of the custom field.
ordinal: integerThe ordinal number that is assigned to the custom field. This number determines the sort order in the issues list and full page issue view.

The following properties are available for custom fields with specific data types. These properties are read-only.

PropertyField TypeDescription
colorIndex: integerEnumFieldThe index number of the color that is associated with this value.
isResolved: BooleanStateTrue if this particular value is regarded as resolved.
owner: userOwnedFieldThe user who is the owner for this value. For example, the owner of a subsystem.
ordinal: integerOwnedField, EnumFieldThe index of the value in the field.
assembleDate: dateBuildThe date when this build was assembled.
releaseDate: dateVersionThe date when this version was released (can be null).
released: BooleanVersionTrue if this version is released.
archived: BooleanVersionTrue if this version is archived.

Custom Field-related Methods and Operations

The following method is available for all custom fields.

getPresentation

SyntaxgetPresentation(): string
DescriptionReturns the presentation of the value for a custom field.
Example
if (!Type.name.eq(Type.getPresentation(), opts)) { message("The " + Type.getPresentation() + " has been changed."); }

The following operations are available for all custom fields.

becomes(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(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(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(): Boolean
DescriptionChecks whether a the value of the custom field is changed in the current transaction.
Example
oldValue(): [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(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"); }

Project Field Properties

The following property is available for a project field.

PropertyDescription
nullValueText: stringThe empty value text. Returns a null value when not set.

Project Field-related Methods

Project fields represent the list of all the custom fields attached to the project. While the methods described in Custom Fields relate to the values of the custom fields, these methods refer to definition of the fields in the project.

getValuePresentation

SyntaxgetValuePresentation(issue: issue): string
ParametersissueThe issue for which the value presentation is returned.
DescriptionReturns the string presentation of the value that is used for this field in the specified issue.

getBackgroundColor

SyntaxgetBackgroundColor(issue: issue): string
ParametersissueThe issue for which the background color is returned.
DescriptionReturns the background color that is used for this field value in the specified issue. Can return null, "write" or a hex color presentation.

getForegroundColor

SyntaxgetForegroundColor(issue: issue): string
ParametersissueThe issue for which the foreground color is returned.
DescriptionReturns the foreground color (the same logic as above).
Last modified: 29 September 2016