• Products
  • Get started
  • Documentation
  • Resources

Use placeholders to replace information depending on context

Assets in Jira Service Management 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 and why would we want to use placeholders?

Some use cases to illustrate when placeholders would come to the rescue: 

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 moved to a specific status.

What these two use cases have in common is that we know "where to find the value" but not what the specific value will be at the time we are setting up our configuration. That's when / why we need to use placeholders to "find the desired value" when needed.  

The placeholder is something to use when configuring an action and the value that we want to have is dependent on the context of the runtime. E.g. we do not know which object will be triggering the action and therefore we do not know the value. 

Placeholder structure

The placeholders are structured like this:

Syntax

${Name of placeholder}

or

${Name of placeholder${Number}}

These multiple structures offer a variety of configuration possibilities. The following table describes how these structures are used.

Placeholder

What 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}

myemail@fakse.se,anotheremail@fakse.se

${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}}

myemail@fakse.se,anotheremail@fakse.se

${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}}

myemail@fake.se

${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}}

anotheremail@fakse.se

${Email${4}}

<empty value>

Context with placeholders

Sometimes placeholders can supply multiple values. If that is the case the placeholder ${Name of placeholder${i}} can be used.

The most common configuration is ${Name of placeholder${0}} which renders a comma separated list of all values provided by the placeholder e.g.

Attribute IN ( ${Name of placeholder${0}} )

It's possible to use ${Name of placeholder${1}} to get hold of only the first value as well.

 

Import

Placeholders can also be used when importing data into Assets in Jira Service Management. Learn more about how placeholders are used when importing.

Placeholder Name

Value

Data locator

The value that is found in the external data source from the data locator

The placeholders are used as part of the Assets Query Language (AQL).

Automation

Learn more about automating Assets in Jira Service Management.

Placeholder Name

Value

Description

Attribute Name

The attribute value

The value of the attribute with the same name as the placeholder. This will render the attribute in the human readable form.

Attribute Name.id

The attribute value as stored

The 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.

label

The label of the object

The value is replaced by the configured label for the object.

objectType

The object type name of the object

The value is replaced by the object type name.

objectTypeId

The object type id

The value is replaced by the id of the object type of the current object.

objectId

The objects id (not the key)

The integer that identifies this object.

Key

The key of the object

The 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 Name

Value

Description

Attribute Name

The attribute value

The value of the attribute with the same name as the placeholder. This will render the attribute in the human readable form

Attribute Name.id

The attribute value as stored

The 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.

The placeholders used by the AQL are always the value to the right-hand side of the configuration and the placeholders are replaced by values from the current object but the AQLis referencing attributes from the target object type. 

Placeholders cannot be used in the Filter Scope (AQL) field in the Assets Objects Field Configuration screen.

 

Still need help?

The Atlassian Community is here for you.