Advanced: Placeholders

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

Assets supports a wide range of different placeholders that allow you to dynamically replace a specified placeholder with anything from an Issue field value, Assets Object attribute value or other Assets related information depending on the context.

When to use placeholders?

Here are some use cases that will show you how placeholders work:

  • Get an email when a license is about to expire, with the name and end date of that specific license.
  • Set/update an object attribute with the value from an issue field when issue is transitioned to a specific status.

What these use cases have in common is that you know where to find the value, but not what the value will be at the time when you'll need it. Placeholders will find the right value.

Placeholder structure

The placeholders are structured like this:

${Name of placeholder}
or
${Name of placeholder${Number}}

The following table describes how placeholders are used, with some examples:

PlaceholderWhat it does

Example placeholder

Replaced with value
${Name of placeholder}Replaces the content ${Name of placeholder} with the value matched by Name of placeholder${Name}One object
${Email}user@example.com, anotheruser@example.com
${Name of placeholder${0}}Replaces the content ${Name of placeholder${0}} with all values matched by Name of placeholder. This is used to match multiple values e.g. when populating an attribute with multiple cardinality and all values will be one instance of that attribute. When replaced as text this is similar to the above example but when replaced in a multi value context this notation will render multiple values but the above will render one value as a comma separated string.${Price${0}}12
${Email${0}}user@example.com, anotheruser@example.com
${Name of placeholder${1}}Replaces the content ${Name of placeholder${1}} with the first value matched by Name of placeholder. This is used when only the first value is required${Price${1}}12
${Email${1}}user@example.com
${Name of placeholder${n}}Replaces the content ${Name of placeholder${n}} with the n:th value matched by Name of placeholder. This is used when only the n:th value is required${Price${2}}<empty value>
${Email${2}}anotheruser@example.com
${Email${4}}<empty value>

Placeholder context

Placeholders can replace different data for different contexts (custom fields, automation, post functions).

Automation rules

For more info on automation rules, see Automation rules.

Placeholder nameValueDescription
Attribute NameThe attribute valueThe value of the attribute with the same name as the placeholder. This will render the attribute in the human readable form.
Attribute Name.idThe attribute value as storedThe value of the attribute with the same name as the placeholder. This will render the attribute in the form that is stored. e.g. if the attribute is an object reference this will render the referenced object id. This will only work on attributes that are stored with another value than presented.
labelThe label of the objectThe value is replaced by the configured label for the object.
objectTypeThe object type name of the objectThe value is replaced by the object type name.
objectTypeIdThe object type idThe value is replaced by the id of the object type of the current object.
objectIdThe objects id (not the key)The integer that identifies this object.
KeyThe key of the objectThe key value of the current object.

Object create / edit

When creating or editing objects with object reference attributes you can specify an AQL that is used to limit the selection of objects. The placeholders available are all the attributes available in the create/edit dialog. 

Placeholder nameValueDescription
Attribute NameThe attribute valueThe value of the attribute with the same name as the placeholder. This will render the attribute in the human readable form
Attribute Name.idThe attribute value as storedThe value of the attribute with the same name as the placeholder. This will render the attribute in the form that is stored. e.g. if the attribute is an object reference this will be the id of the object that is referenced.
Example use case

Let’s say you have three object types: Customers, Sites, and Rooms, where each room belongs to a particular site. You can set this up by defining an attribute of type Object in the Room object type with relation to Site, set to max 1.

Cardinality tab set to max 1 in the Site attribute configuration dialog

Each customer is associated with a site and a room. However, when you select a site for a customer, you would not want rooms from other sites available for selection. To filter out the unwanted information, you can add placeholders. To do this, go to the attribute list of object type Customers and select Configure against the Room attribute. In the Filter objects tab, type Site = $(Sites) in the Filter by IQL tab. Sites is the attribute of the Customer object, and when it is selected during object creation or configuration, only the sites that belong to it are available for selection in the Site field.

Filter by IQL set to reference sites in the configure room dialog


Post-functions

For more info on post-functions, see Post-functions.

The following post-functions support placeholders: 

  • Email user(s) based on attribute in a selected Assets object
  • Set the value of an object attribute with a predefined value
  • Assign object/s based on an AQL query

Custom fields

For more info on custom fields, see Assets custom fields.

The standard Assets custom field "Assets Object/s" supports placeholders for any issue field data. This is configured in the "Issue Scope AQL" and can be constructed as the following example:

Organisation = ${customfield_12345.name} AND Location = ${Country} AND "Issue Type" like ${issuetype.name}

The placeholders will be replaced with the identifiers for the specific underlying objects. Remember to use IN in the AQL if you have multiple values.

Custom field keyCustom field name${placeholder.id} / ${placeholder.key}${placeholder.label} / ${placeholder.name}
${customfield_xxxxx}<Custom Field Name>The identifierThe label / name

The table below shows the keys for issue placeholders to use for Jira fields. Some fields, such as status, won't be available while creating an issue. Make sure to use IN for multi values to not break the AQL. 

Issue keyLabel / DescriptionMultipleType${key.id}${key.label}
affectedVersionsAffected VersionstrueVersionIdName
assigneeAssigneefalseApplicationUseruserKeyDisplay Name
descriptionDescriptionfalseStringdescriptiondescription
duedateDue DatefalseDateduedateduedate
fixVersionsFix VersionstrueVersionIdName
environmentEnvironmentfalseStringenvironmentenvironment
issuetypeIssue TypefalseIssueTypeIdName
labelsLabelstrueStringlabelslabels
componentsComponentstrueProjectComponentIdName
priorityPriorityfalsePriorityIdName
pidProjectfalseProjectIdName
reporterReporterfalseApplicationUseruserKeyDisplay Name
summarySummaryfalseStringsummarysummary
(warning) The following fields won't be available while creating an issue
keyThe Issue KeyfalseStringkeykey
issuekeyIssuekeyfalseStringkeykey
resolutionResolutionfalseResolutionIdName
votesVotestrueLongvotesvotes
watchersWatcherstrueLongwatcherswatchers
resolutiondateResolution DatefalseDateresolutiondateresolutiondate
creatorCreatorfalseApplicationUseruserKeyDisplay Name
createdCreatedfalseDatecreatedcreated
updatedUpdatedfalseDateupdatedupdated
statusStatusfalseStatusIdName

The issuetype placeholder won't work for Jira Service Management requests. You must use a custom field instead:

Wrong: issuetype
"Related Jira Projects" = currentProject() AND "Related Jira Issue Types"."Name" in (${issuetype.label}) AND Status = "Active"
Right: customfield
"Related Jira Projects" = currentProject() AND ("Related Jira Issue Types"."Name" in (${issuetype.label}) OR "Related Jira Issue Types"."Name" in (${customfield_10654})) AND Status = "Active"
Last modified on Nov 8, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.