Issues
The current issue that is changed by the workflow rule is referenced as issue
.
When you reference an issue in a workflow rule, you can omit the issue
and enter the property or method.
For example, issue.Assignee = issue.reporter
and Assignee = reporter
do the same.
Issue Properties
Any property that returns a sequence
type has a set of extended properties that are available for all sequence types.
There are also operations that you can use to find, add, remove, and clear elements in the sequence.
For more information, see Sequences
The following properties are available for issues.
Each property is presented in the following format: [property name]: [data type]
.
Property | Description | State |
---|---|---|
reporter: User | The user who reported the issue. For example, Assignee = reporter sets the user who reported the issue as the assignee. | Read-only |
created: date | The date when the issue was created. | Read-only |
updated: date | The date when the issue was last updated. | Read-only |
resolved: date | The date when an issue was set to a value that is considered resolved.
When an issue enters a resolved state, the issue.resolved date is set to that moment.
When an issue returns to an unresolved state, the property is set to a null value. | Read-only |
permittedGroup: UserGroup | The user group for which the issue is visible. If the property contains a null value, the issue is visible to the All Users group. | Read-only |
comments: sequence<IssueComment> | A list of comments that have been added to the issue. For comment-related methods, see getEditedComments and addComment. | Read-only |
attachments: sequence<Attachment> | The read-only list of attachments for the issue. See also clearAttachments. | Read-only |
duplicateCluster: integer | The number of issues that are linked to the current issue with the duplicates link type. | Read-only |
project: Project | The project to which the issue is assigned. See also Project-related Methods. | Read/write |
summary: string | The text that is entered as the issue summary. | Read/write |
description: string | The text that is entered as the issue description. | Read/write |
votes: integer | The number of votes for an issue. For vote-related methods, see canVoteIssue, voteIssue, canUnvoteIssue, and unvoteIssue. | Read/write |
tags: sequence<Issue> | The list of tags that are attached to an issue. For tag-related methods, see hasTag, addTag, removeTag, getTag, and getSharedTag. | Read/write |
numberInProject: integer | The issue number in the project. | Read/write |
[link type name]: sequence<Issue> | The list of issues that are linked to the current issue with the specified link type name. | Read/write |
[field name]: [field type] | The value for the specified custom field. For example, Assignee returns a user , while State returns a state value.
If a custom field has an enumerated type, this property returns a sequence. | Read/write |
sprints: sequence<Sprint> | The list of sprints to which an issue is assigned. | Read/write |
IssueComment Properties
The following properties are available for comments.
IssueAttachment Properties
The following properties are available for attachments.
IssueTag Properties
The following properties are available for tags.
Property | Description | State |
---|---|---|
name: string | The name of the tag. | Read-only |
owner: User | The user who is the owner of the tag. | Read-only |
Issue-related Methods
Changes that are applied to issue are managed by a series of transactions. A transaction is a collection of current changes that are either saved to the database or discarded as a set. When a user edits an issue, a new transaction is started. The transaction is completed when the user clicks the Submit button. The single transaction includes all of the changes that were made to the issue.
Rules that are not executed according to a schedule are processed at the end of a transaction. Scheduled rules and scheduled blocks in state-machine rules are only processed for issues that are already reported or become reported in the current transaction.
The following methods are available for use with issues.
The syntax for each method is presented in the following format: [method](parameter: [data type]): [data type]
.
getId
Syntax | getId(): string |
---|---|
Description | Returns the issue ID. |
Example | user.notify("Issue is overdue", "Please, look at the issue: " + issue.getId()); |
getUrl
Syntax | getUrl(): string |
---|---|
Description | Returns the issue URL. |
Example | user.notify("Issue is overdue", "Please, look at the issue: " + issue.getUrl()); |
createCopy
Syntax | createCopy(): Issue |
---|---|
Description | Clones the current issue. |
applyCommand
getEditedComments
addComment
clearAttachments
Syntax | clearAttachments(): void |
---|---|
Description | Remove all of the attachments from an issue. |
hasTag
Syntax | hasTag(name: string): Boolean | |
---|---|---|
Parameters | name | The name of the tag to check for an the issue. |
Description | Checks whether the specified tag is attached to an issue. | |
Example | hasTag("todo"); |
isStarred
Syntax | isStarred(): Boolean | |
---|---|---|
Description | Checks whether any user has added the star tag to an issue. |
addTag
removeTag
getDuplicateRoot
Issue Lifecycle Methods
The following methods are related to the lifecycle of an issue. The lifecycle of an issue consists of the following stages:
isReported
becomesReported
The following methods are related to the issue.resolved
property.
This property is set based on the values that are stored in a custom field with a state
data type.
Each value that can be stored in this field has a Resolved property.
This property determines whether the issue is considered to be resolved when it assigned a value for this field.
The resolved
property is associated with the issue, which means that these methods do not contain references to the custom field.
isResolved
becomesResolved
becomesUnresolved
Notification-related Methods
These methods can be used to send notifications to unregistered users with an email address. To send notifications to existing users, use the following methods: