Variables
When using macros, triggers, and auto actions, you can insert values from the issue filled to the comment, formula, or HTTP request using variables
Add variable
-
Create a macro, trigger or auto action.
-
Click Add variable in the action block of the trigger or auto action. In the case of a macro, add a variable to the message section.
-
Choose the field from the list. When the action is executed, the field value will replace the variable in the text. You can also insert issue parameters that are missing in the variable list. For this, enter the variable name into the text.
Note
The list shows variables for all the fields available in Tracker. If you select a variable not used in a queue or issue for a field, the value will not be substituted.
Variable types
The variable names assigned to issue fields, have the format: {{issue.<field_key>}}
. To get a specific parameter of an issue field, use the following format: {{issue.<field_key>.<parameter>}}
.
User attributes
You can use default variables to get the user's first and last name. To obtain specific user attributes, use a variable in the format {{issue.<role>.<attribute>}}
, where <role>
is the role and name of the field in which the user is specified, and <attribute>
is the attribute.
Warning
Starting October 1, 2023, the default user ID type changed from passportUid
to uid
. Therefore, we recommend that you explicitly specify user ID type when performing integration.
User roles:
assignee
: Issue assigneeauthor
: Authorfollowers
: Followersaccess
: Users from the Access field
User attributes:
Login
: LoginfirstName
: First namelastname
: Last nameuid
: ID in Trackeremail
: Email address*cloudUid
: ID in Yandex Cloud OrganizationpassportUid
: ID in Yandex 360 for Business organization and Yandex ID
For example, by using the {{issue.followers.email}}
variable, you can get email addresses for all the issue's followers.
Note
Usernames that only contain numbers may be interpreted incorrectly when executing requests to Tracker. In the event of an error, we recommend using the uid
attribute instead of the login
one.
Additional issue parameters
Some issue parameters are not displayed in fields, but you can get their values using variables as well:
Variable | Value |
---|---|
{{issue.parent}} |
Parent issue |
{{issue.previousStatus}} |
Previous issue status |
{{issue.previousQueue}} |
Previous issue queue |
{{issue.checklistDone}} |
Number of completed items from the checklist |
{{issue.votes}} |
Number of votes for the issue |
Local fields
The variable names assigned to local issue fields have the {{issue.local.<field_ID>}}
format.
Date and time modifiers
By default, the date and time is transmitted as DD month YYYY
, e.g., 07 december 2021
. For other formats of date and time, use modifiers:
iso8601
: ISO 8601 format.unixEpoch
: Unix Time format.date
: Writing only date for the fields transmitting date and time.
Here are the examples of variables with date and time modifiers:
Variable | Value | Notation format |
---|---|---|
{{currentDateTime.iso8601}} |
Current date and time in ISO 8601 format | YYYY-MM-DDThh:mm:ss.sssZ |
{{currentDateTime.unixEpoch}} |
Current time in Unix Time format | 1638735223 |
{{currentDateTime.date}} |
Current date | 06 december 2021 |
{{issue.start.iso8601}} |
Issue start date in ISO 8601 format | YYYY-MM-DD |
{{issue.start.unixEpoch}} |
Issue start date in Unix Time format | 1638855321 |
JSON modifiers
Some fields can accept multiple values. To get or transmit values from such fields, for example, in HTTP requests, convert time to JSON format. For this, add .json
to the variable name.
Examples of variables in JSON format:
Variable | Value | Notation format |
---|---|---|
{{issue.summary.json}} |
Issue name | "Issue name" |
{{issue.description.json}} |
Problem description | "Description" |
{{issue.tags.json}} |
Tags | ["tag1","tag2"] |
{{issue.<role>.login.json}} |
User login (for the author and assignee fields) |
"ivan-ivanov" |
{{issue.<role>.uid.json}} |
User ID (for the author and assignee fields) |
88******** |
{{issue.<role>.login.json}} |
Logins of users (for the followers and access fields) |
["ivan-ivanov", "user3993"] |
{{issue.components.display.json}} |
Components | ["component1","component2"] |
{{issue.<роль>.cloudUid.json}} |
User IDs in Yandex Cloud Organization (for the followers and access fields) |
[bf********, cq********] |
{{issue.<роль>.passportUid.json}} |
User IDs Yandex 360 for Business organization and Yandex ID (for the followers and access fields) |
[88********, 55********] |
{{issue.<роль>.uid.json}} |
User IDs (for the followers and access fields) |
[88********, 55********] |
Warning
Tracker supports transmitting values in JSON format for simple field types that have such formats as string, number, and arrays of strings or numbers. The Object field type is not supported, e.g., the {{issue.author.json}}
variable will not work. Instead, you can use a variable to get a simple field attribute: {{issue.author.login.json}}
.
Comments
Using variables, you can get some attributes of issue comments. These variables have the {{<comment_type>.<attribute>}}
format, where <comment type>
is selected depending on the author (user or robot), and <attribute>
is the comment's parameter.
The possible values for <comment_type>
are:
userComment
: Comment from the current edit operation. If a user has made more than one comment, the first one will be considered.generatedComment
: Comment generated automatically as a result of a fired trigger or auto action.
Use the parameters below to get comment details:
Variable | Value |
---|---|
{{<comment_type>.id}} |
Comment ID |
{{<comment_type>.text}} |
Text of the comment |
{{<comment_type>.author}} |
Comment author |