An issue has a number of specific default attributes, like issue reporter, or issue links, which in workflow are treated as fields. Some of them, like reporter, for example, are fields with read-only access, i.e. you can only get this field's value, not update it.
Method
Description
reporter
Read-only access. Allows to get issue reporter. E.g.
will set issue reporter as assignee for the current issue.
project
Allows to get a project to which issue belongs.
created
Read-only access. Signifies 'created' date for an issue.
updated
Read-only access. Signifies 'updated' date for an issue.
resolved
read-only access. Signifies 'resolved' date for an issue, a date when issue's state is set to a value, which is considered as 'resolved' state (e.g. Fixed, Duplicate, Obsolete, etc.)
summary
Signifies issue's summary text.
description
Signifies issue's description text.
<link name>
A list of links of specified name for an issue.
comments
List of comments for an issue.
votes
Number of votes for an issue.
Methods Applicable to an Issue
In general case you should use issue.<method> construction. However, workflow language supports 'short' presentation, i.e. instead of issue.isReported you can use just isReported.
Method
Description
getId()
Allows to get issueId.
getUrl()
Get issue's URL.
Unlike the getId() method, this one will result in showing an URL to the issue, not just issueID.
addComment(string):void
Create new comment for the current issue.
clearAttachments():void
Clear
isReported
Boolean. Allows to check if issue is reported. Applied to both just reported (the current update operation is submitting issue) and reported issues. To address an issue draft (not yet submitted issue), use the !isReported construction.
isResolved
Boolean. Allows to check if issue is resolved (has a State value, which considered as Resolved: e.g. Fixed, Obsolete, Duplicate, etc.)
Methods Applicable to Issue Fields
General syntax for these methods is <field_name>.<method>.
Method
Description/Notes
required
Assert that a value for the field is set.
isEmpty
Applicable to collections of values (enumeration bundles, builds, subsystems, links, etc.). Checks whether an list of values is empty.
isNotEmpty
Applicable to collections of values (enumeration bundles, builds, subsystems, links, etc.). Checks whether an list of values is not empty.
changed
Checks that the field is changed during the update.
becomes
Checks that a field is set to a particular value during the current issue change.
canBeReadBy
Checks permissions to view the specified field.
canBeWrittenBy
Checks permissions to update the specified field.
oldValue
Allows to get an old value of the specified field, a value before the change.
getPresentation():string
Get presentation of the field's value.
Tag Related Methods
Please note that these methods also relate to set a user as watcher for an issue, because adding a watcher to an issue is per se adding the specific Star tag to the issue on behalf of this user.
Method
Description/Notes
User.watchIssue(Issue)
Add currently logged-in user as watcher for an issue (add 'Star' tag).
User.unwatchIssue(Issue)
Remove user from watchers list of the issue (remove 'Star' tag).
Find tag visible to the user. If createIfNotExists parameter is true and no tag with the given name is visible to the user and user has sufficient permissions to create tags, then new tag with the given name will be created.
Votes Related Methods
The following methods are available since YouTrack 4.0.2:
Method
Description/Notes
user.voteIssue(issue)
Adds a vote of the user to the issue, if it is allowed.
user.unvoteIssue(issue)
Removes a vote of the user from the issue, if it is allowed
user.canVoteIssue(issue)
Returns boolean denoting whether the user can vote for the issue
user.canUnvoteIssue(issue)
Returns boolean denoting whether the user can unvote the issue
Miscellaneous methods
Method
Description/Notes
loggedInUser
Signifies a currently logged in user, who is updating an issue.
createNewIssue("projectId")
Method allows to create a new issue in a project with specified projectId. Must be used on behalf of loggedInUser:
The example above means that the current user create new issue in project with 'TST' projectId.