Jira smart values - issues
To test what your smart value returns, use the manual trigger with log action and the result displays in the audit log.
Smart values on this page:
- issue
- issues
- issue.comments
- issue.components
- issue.epic
- issue.fixVersions
- issue.latest
- issue.parent
- issue.properties
- issue.project
- issue.Request Type
- issue.security.name
- issue.url
- issue.versions
- issue.watchers
- lookupIssues
- triggerIssue
- attachment
- baseUrl
- changelog
- comment
- createdIssue
- createdIssues
- eventType
- fieldChange
- Jira Service Management’s customer satisfaction
- rule
- sprint
- version
- webhookData
- webhookResponse
- worklog
- Asset fields
- Tempo Account field
issue
The active issue. Through the dot notation you can access fields like issue type, status and custom fields (details on how you can use these to interact with Jira's api are here)
{{issue.components.name}}
{{issue.created.format("dd/MM/yyyy")}} - this is the date the issue was created
displayed in the format 21/03/2019
{{issue.description}} - the content in the description field
{{issue.project}} - the project this issue is a part of.
{{issue.duedate}} - this is the due date for scheduled issue
{{issue.issuetype.name}} - the name of the type of issue
{{issue.key}} - the issue's unique identifier, comprised the project key and the
issue's number
{{issue.status.name}} - the name of the status the issue is at in its workflow.
{{issue.toUrl}} - use this to display a url
{{issue.CustomField.property}} - some of these are:
* {{issue.CustomField.id}} - the unique id for the field assigned by Jira. It is
better to use this than name as it cannot be changed.
* {{issue.CustomField.name}} - the visible label displayed on the left of the
field
* {{issue.CustomField.description}} - the text displayed below the custom field
viewed in the Simple Search column.
* {{issue.CustomField.defaultValue}} - the value displayed on first view of the
field
issues
A list of issues generated by a trigger that runs a JQL search (Incoming Webhook trigger or Scheduled trigger when set to process in bulk). All of the issues found by the trigger are then treated as a single bundle of issues. You could then use this to count the number of issues returned. For example, you might count how many issues have a priority of 'highest' and then send an alert. Or you could count how many issues have the same label, same fixVersion, etc. You can also use this with lists. For more information on when issues is available, see Run a rule against issues in bulk.
{{#issues}}{{key}}{{/}} - the key for each issue
{{issues.size}} - count of the issues
issue.comments
Multiple comments on the active issue (this example is explained in detail in how to use smart values)
{{#issue.comments}}
Comment by: {{author}} at: {{created}}
{{body}}
{{/}}
{{issue.comments.last.body}}
{{issue.comments.first.body}} - the body of the first of many comments
{{issue.comments.size}} - count of comments for the issue
{{#issue.comments}}{{#first}}First:{{author.key}}{{/}}{{body}}{{/}} - prints all of the comments and only prints the first author's key
issue.components
Components of an issue as a list. See accesing multi-value fields
{{issue.components.first.name}}
issue.epic
Added by: This is added any time an issue is added
If this issue is in an Epic, then epic refers to the Epic issue. You can access all fields of the Epic.
{{issue.epic.key}}
{{issue.epic.status.name}}
{{issue.epic.My Custom Field}}
issue.fixVersions
Fix versions of an issue as a list. See accesing multi-value fields.
Properties for versions include: name, description, archived, released, releaseDate
{{issue.fixVersions.first.releaseDate}}
issue.latest
This re-fetches the latest state of the issue from Jira.
{{issue.latest.description}}
Tip
This should not be used since it requires an expensive reload of issue data. The only situation where this is necessary, is where subsequent actions need to have visibility of the latest state of the issue (e.g. 2 edit issue actions that need to 'add' to the value of a field instead of overwriting it).
issue.parent
If this issue is a sub-task, then parent refers to the parent issue. You can access all fields of the parent.
{{issue.parent.key}}
{{issue.parent.priority.name}}
{{issue.parent.Epic Link}}
{{issue.parent.epic.summary}}
issue.properties
Here you can access any issue property. Properties are frequently used by add-ons and integrations to store values.
{{issue.properties.some.value}}
issue.project
This smart-value allows you to access project specific attributes:
{{issue.project.key}}
{{issue.project.name}}
issue.Request Type
Jira Service Management specific request type object that you can grab information from.
{{issue.Request Type}}
{{issue.Request Type.requestType.name}} - Customer request type
{{issue.Request Type.currentStatus.status}} - Current status
{{issue.Customer Request Type}} - Customer request type for older Jira instances
The "Request Type" prefix may be
"Customer Request Type" in older instances of Jira. You can check this by navigating to the "Custom fields" page in the
global admin section. There should be a locked field named either "Request Type" or "Customer Request Type" there.
issue.security.name
The text of the security level.
{{issue.security.name}}
{{issue.security.id}}
issue.url
The URL to access the issue. Also provides the customer portal URL for Jira Service Management issues.
{{issue.url}}
{{issue.url.customer}}
issue.versions
Affects version of an issue as a list. See accesing multi-value fields.
Properties for versions include: name, description, archived, released, releaseDate
{{issue.versions.first.releaseDate}}
issue.watchers
You can access the current watchers of an issue.
{{issue.watchers.displayName}}
{{issue.watchers.emailAddress}}
lookupIssues
Returns a list of issues from a JQL search used by the Lookup issues action. Learn more about the Lookup issues action
The properties available for the {{lookupIssues}}
smart value are listed in the following section.
The smart value {{lookupIssues.<property_name>}}
will contain the property of each issue from the JQL search, in a list format.
You can iterate through the list of issues from the JQL search by using the syntax {{#lookupIssues}} {{/}}
.
Available properties
Examples of using the lookupIssues value
Create a list of the keys of all the issues from the JQL search:
These are the issue keys found by the JQL search {{lookupIssues.key}}.
Iterate through each issue using a loop and print the keys in bullet point form:
These are the issue keys found by the JQL search:
{{#lookupIssues}}
* {{key}}
{{/}}
Sum all of the story points for issues returned from the JQL search:
There are {{lookupIssues.Story Points.sum}} story points remaining.
Retrieve the highest story point value for issues returned from the JQL search:
The highest story point value is {{lookupIssues.Story Points.max}}.
triggerIssue
Added by: The Related Issues Action.
Refers to the original issue when you branch the chain.
{{triggerIssue.description}}
... all fields available to {{issue}}
are available here as well.
attachment
This {{attachement}}
smart value retrieves all the attachments of an issue as a list object.
To access the raw data from the attachments, use the following smart value:
{{attachment.filename}} // Provides the filename of each attachment
{{attachment.mimeType}} // Provides the file format of each attachment
{{attachment.author}} // Provides the user who added each attachment
{{attachment.author.accountId}} // Provides the ID associated with the user who added each attachment
{{attachment.author.emailAddress}} // Provides the email address associated with the user who added each attachment
{{attachment.author.displayName}} // Provides the display name associated with the user who added each attachment
{{attachment.author.active}} // Provides the status (active/inactive) of the user who added each attachment
{{attachment.author.timeZone}} // Provides the timezone of what timezone of the user who added each attachment
{{attachment.created}} // Provides the date and time each attachment was added to the issue
{{attachment.size}} // Provides the size in bytes of each attachment
You can iterate through the list of attachments added to the issue using the syntax {{#attachments}}
. Check how to use smart values with issue lists
For example, if you want to include a link to each attachment of an issue in a comment, use the expression below in the Comment on issue action:
{{#attachment}}
[^{{filename}}]
{{/}}
To include all attachments as thumbnails in a comment, use the following expression in the Comment on issue action:
{{#attachment}}
!{{filename}}|thumbnail!
{{/}}
baseUrl
Prints the url of the Jira instance
changelog
Added by: Jira Triggers that edit an issue
All the fields that were changed. Each field is a list of changes. You can access useful things like the previous status during a transition. This is only available for the following triggers:
- Issue Moved
- Issue Transitioned
- Field Value change
- Issue updated
- Multiple Issue Event (Issue Updated)
{{#changelog.summary}}
{{toString}}
{{/}}
{{#changelog.issuetype}}
{{fromString}}
{{/}}
// Previous status name
{{#changelog.status}}{{fromString}}{{/}}
// Previous status id (for using in another Edit action
{{#changelog.status}}{{from}}{{/}}
comment
Added by: Jira Triggers that contain a comment. E.g. Issue commented
{{comment.body}}
{{comment.author}}
{{comment.created}}
{{comment.visibility.type}} - comment restriction type, if any e.g. role
{{comment.visibility.value}} - comment restriction label, if any e.g. Developers
{{comment.internal}} - for Jira Service Management comments, returns false if the comment is visible to customers.
{{comment.properties}} - Way to access any comment property. Properties are frequently used by add-ons and integrations to store values.
{{comment.properties."sd.public.comment".internal}}
createdIssue
The previous issue created in this rule
{{createdIssue.some field}}
createdIssues
Added by: Clone Issue Action, Create Issue Action, Create Sub-tasks Action
A list of issues that have been created in the rule
{{#createdIssues}}{{key}}{{/}}
eventType
The type of event that triggered the rule such as: jira:issue_updated :issue_commented
{{eventType}}
fieldChange
The {{fieldChange}
} smart value lets you access the value of a field that has changed. It's only available when the Field value changed trigger is used in the automation rule.
You can use the following properties for this smart value:
{{fieldChange.fromString}} // Returns the previous value as displayed.
{{fieldChange.toString}} // Returns the new value as displayed.
{{fieldChange.from}} // Returns the previous raw value of a field, i.e. the JSON representation of the value.
{{fieldChange.to}} // Returns the new raw value of a field, i.e. the JSON representation of the value.
The properties
{{fieldChange.from}}
and {{fieldChange.to}}
aren't available for all types of fields. For example, fields of type text and number will return a null value.
The
{{fieldChange}}
smart value only contains the first changed value. If multiple values are changed, such as when setting multiple Fix Versions, you can iterate over these using the expression below. Explore how to use smart values with issue lists
{{#changelog.fix Version}}{{toString}}{{/changelog.fix Version}}
Jira Service Management’s customer satisfaction
rate
Returns the value of the Jira Service Management’s rate custom field.
{{issue.Satisfaction.rate}}
scale
Returns the value of the Jira Service Management’s scale custom field.
{{issue.Satisfaction.scale}}
rule
{{rule.name}} - Prints out the name of the running rule
{{rule.actor}} - Accesses the rule actor user.
sprint
Added by: Sprint created, started or completed triggers
{{sprint.id}}
{{sprint.name}}
{{sprint.isStarted}}
{{sprint.isClosed}}
{{sprint.startDate}}
{{sprint.endDate}}
{{sprint.completeDate}}
{{sprint.originBoardId}}
{{sprint.goal}}
version
A representation of a release/version in Jira.
{{version.name}}
{{version.id}}
{{version.description}}
{{version.archived}}
{{version.startDate}}
{{version.released}}
{{version.releaseDate}}
{{version.project.key}}
{{issue.versions.first.name}}
webhookData
Added by: Webhook Trigger
This allows access to data that was sent along with the incoming webhook
The body of the Webhook request
{{webhookData.someValue.childValue}}
webhookResponse
Added by: Send web request with "Wait for response" checked
On successful request, you will be able access webhook response data using the following smart values:
{{webhookResponse.status}} - response code e.g. 200
{{webhookResponse.headers}} - headers that can be accessed with dot nation
{{webhookResponse.headers.Content-Type}}
{{webhookResponse.body}} - body that can be accessed with dot nation
{{webhookResponse.body.name}}
{{webhookResponses}} - list of responses made when list operations
{{webhookResponses.last.body}}
Multiple responses can be access via the following fields:
{{webhookResponses.last.someValue.childValue}}
{{#webhookResponses}}
Data from response: {{someValue.childValue}}
{{/}}
worklog
Added by: Worklogged Trigger
The worklog entry that has just been logged against an issue.
{{worklog.comment}}
{{worklog.started}}
{{worklog.timeSpentSeconds}}
// Cloud only
{{worklog.timeSpent}}
// Visibility is available when the worklog is restricted
{{worklog.visibility}}
{{worklog.visibility.type}}
{{worklog.visibility.value}}
Asset fields
We don't currently support accessing fields within Asset objects. In the code, the smart value still refers to its legacy name: InsightField.
You can access an Asset field's full name, key, or summary through the following smart values:
{{issue.InsightField}} // returns Some Client Name (ABC-123)
{{issue.InsightField.key}} // returns ABC-123
{{issue.InsightField.summary}} // returns Some Client Name
Tempo Account field
You can access a Tempo Account field's properties through the following smart values. To make sure the field work correctly, replace TempoAccountField
with one of the following data:
- use the actual Tempo Field Name, which is Account by default
- or use
customfield_XXXX
, whereXXXX
is the ID of the Tempo custom field.
{{issue.TempoAccountField}} // Provides the name of the account
{{issue.TempoAccountField.id}} // Provides the ID of the account
{{issue.TempoAccountField.name}} // Provides the name of the account
{{issue.TempoAccountField.key}} // Provides the key of the account