Fields
Contains all issue custom fields.
Properties
Name | Type | Description | Read-only |
---|---|---|---|
'Affected versions' | | Custom field of type Set<ProjectVersion> | |
'Due Date' | | Custom field of type Number | |
'Fix versions' | | Custom field of type Set<ProjectVersion> | |
'Fixed in build' | | Custom field of type Build | |
Assignee | | Custom field of type User | |
Priority | | Custom field of type EnumField | |
State | | Custom field of type State | |
Subsystem | | Custom field of type OwnedField | |
Type | | Custom field of type EnumField |
Methods
becomes
static becomes(field, expected)
Checks that a value a custom field receives in the current transaction is equal to an expected one.
Parameters
Name | Type | Description |
---|---|---|
field | | the field to check. |
expected | | expected value of the field. |
Return Value
Type | Description | |
---|---|---|
| `true` in case the expectation is met. |
canBeReadBy
static canBeReadBy(field, user)
Checks if a custom field can be read by a user.
Parameters
Name | Type | Description |
---|---|---|
field | | the project custom field to check read access to. |
user | | to check access for. |
Return Value
Type | Description | |
---|---|---|
| `true` in case the custom field can be read by the user. |
canBeWrittenBy
static canBeWrittenBy(field, user)
Checks if a custom field can be written by a user.
Parameters
Name | Type | Description |
---|---|---|
field | | the project custom field to check write access to. |
user | | to check access for. |
Return Value
Type | Description | |
---|---|---|
| `true` in case the custom field can be written by the user. |
isChanged
static isChanged(field)
Checks if a custom field is changed in the current transaction.
Parameters
Name | Type | Description |
---|---|---|
field | | the project custom field (e.g. 'State') or a reference to the field to check. |
Return Value
Type | Description | |
---|---|---|
| `true` in case the custom field is changed in the current transaction. |
oldValue
static oldValue(field)
Returns the previous value of a single-valued custom field before an update was applied. In case 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 project custom field (e.g. 'State') or a reference to get previous value of. |
Return Value
Type | Description | |
---|---|---|
| previous value of the custom field. |
required
static required(fieldName, message)
Checks if a the issue has a custom field set to non-empty value, shows error message otherwise.
Parameters
Name | Type | Description |
---|---|---|
fieldName | | name of the field to check. |
message | | to show in case the field is not set. |