Fields
Represents the custom fields that are used in an issue. The actual set of custom fields that are used for each issue is configured on a per-project basis. The properties shown here correspond with the default custom fields in YouTrack. Additional custom fields that have been attached to a project are also available.
Properties
Name | Type | Description |
---|---|---|
'Affected versions' | Set.<ProjectVersion> | A custom field that stores data as a Set<ProjectVersion> type. |
'Due Date' | Number | A custom field that stores data as a Number type. |
'Fix versions' | Set.<ProjectVersion> | A custom field that stores data as a Set<ProjectVersion> type. |
'Fixed in build' | Build | A custom field that stores data as a Build type. |
Assignee | User | A custom field that stores data as a User type. |
Priority | EnumField | A custom field that stores data as a EnumField type. |
State | State | A custom field that stores data as a State type. |
Subsystem | OwnedField | A custom field that stores data as a OwnedField type. |
Type | EnumField | A custom field that stores data as a EnumField type. |
Methods
becomes
Checks whether the value for a custom field is set to an expected value in the current transaction.
Parameters
Name | Type | Description |
---|---|---|
field | | The field to check. |
expected | Object | The expected value. |
Return Value
Type | Description |
---|---|
boolean | If the field is set to the expected value, returns `true`. |
canBeReadBy
Checks whether a user has permission to read the custom field.
Parameters
Name | Type | Description |
---|---|---|
field | | The custom field to check for read access. |
user | User | The user for whom the permission to read the custom field is checked. |
Return Value
Type | Description |
---|---|
boolean | If the user can read the field, returns `true`. |
canBeWrittenBy
Checks whether a user has permission to update the custom field.
Parameters
Name | Type | Description |
---|---|---|
field | | The custom field to check for update access. |
user | User | The user for whom the permission to update the custom field is checked. |
Return Value
Type | Description |
---|---|
boolean | If the user can update the field, returns `true`. |
isChanged
Checks whether the custom field is changed in the current transaction.
Parameters
Name | Type | Description |
---|---|---|
field | | The name of the custom field (for example, 'State') or a reference to the field that is checked. |
Return Value
Type | Description |
---|---|
boolean | If the value of the field is changed in the current transaction, returns `true`. |
oldValue
Returns the previous value of a single-valued custom field before an update was applied. If the field is not changed in the transaction, this value is equal to the current value of the field.
Parameters
Name | Type | Description |
---|---|---|
field | | The name of the custom field (for example, 'State') or a reference to the field for which the previous value is returned. |
Return Value
Type | Description |
---|---|
Object | If the custom field is changed in the current transaction, the previous value of the field. Otherwise, the current value of the field. |
required
Asserts that a value is set for a custom field. If a value for the required field is not set, the specified message is displayed in the user interface.
Parameters
Name | Type | Description |
---|---|---|
fieldName | string | The name of the custom field to check. |
message | string | The message that is displayed to the user that describes the field requirement. |