Text
This function returns the attribute value for a given asset object key. If the provided key, the attribute ID or name is invalid or empty, null is returned. If the attribute is configured to allow multiple values, these values are returned as a comma‑separated list.
By default, the function returns the textual representation of the attribute value. For some non‑standard attribute types (for example users, projects, etc.), the function returns specific values that are optimized for these types. The exact behavior for these special attribute types is described in the list below.
|
Attribute type |
Attribute value returned |
|---|---|
|
object |
object key, e.g."PTAS-1" |
|
user |
user account id |
|
group |
group name, e.g. "my-jira-group" |
|
project |
project id, e.g. "10005" |
|
status |
name, e.g. "Active" |
|
Bitbucket cloud repository |
repository UUID |
getAttributeFromAsset(objectKey, attributeId) #Output: Text
getAttributeFromAsset(objectKey, attributeName) #Output: Text
Example
|
Parser expression |
Description |
|---|---|
|
Bash
|
This example returns the value of the attribute with ID "123" (attribute type Default/Text) for the asset object with object key "PTAS-1", e.g.:
|
|
Bash
|
This example returns the value of the attribute "Name" (attribute type Default/Text) for the asset object with object key "PTAS-1", e.g.: PHONE-001 |
|
Bash
|
This example returns the value of the attribute "Created" (attribute type Default/Date time) for the asset object with object key "PHONE-001", e.g.: 2024-09-30T10:00:00.000T+02:00 The output format for Date Time attributes is the same as in the Date Picker. |
|
Bash
|
This example returns the value of the attribute "Associated Project" (attribute type Project) for the asset object with object key "PTAS-1", e.g.: 10001,10004 For the Project attribute type, project IDs are returned. |
|
Bash
|
This example returns the value of the attribute "Project team" (attribute type User) for the asset object (for example, from a assets objects custom field with a single object), e.g: 557058:13380c58-4287-4135-9e04-4edec2fafebc,557058:5ed8d5af-b3a8-47dc-9933-b1a815a6cf92,557058:16adef20-023f-44f6-a02c-208f1b6dd736 For the User attribute type, Atlassian account IDs are returned. |
Additional information
Parameters used in this function
|
Parameter |
Input (data type) |
Description |
|---|---|---|
|
|
text |
Text containing a valid single asset object key. |
|
attributeId |
text |
Text containing a valid asset object attribute ID. |
|
attributeName |
text |
Text containing a valid asset object attribute name. |
Output
This function returns a text
Text list
Variant for multiple asset objects. In case one of the given keys is not valid or empty, null is returned to its position on the list.
getAttributeFromAsset(objectKeys, attributeId) #Output: Text list
getAttributeFromAsset(objectKeys, attributeName) #Output: Text list
Examples
|
Parser expression |
Description |
|---|---|
|
Bash
|
This example returns the value of the attribute "Name" (attribute type Default/Text) for the asset objects with object key "PTAS-1" and "PTAS-2", e.g.: PHONE-001, PHONE-002 |
|
Bash
|
This example returns the value of the attribute "Associated Project" (attribute type Project) for the asset objects with object key "PTAS-1" and "PTAS-2", e.g.: 10001,10004,10003 For the Project attribute type, project IDs are returned. Since technically, the output is a text list possibly consisting of comma-separated values, e.g. "10001,10004","10003", you might want to flatten the list by applying toString() to the result. |
|
Bash
|
This example returns the value of the attribute "Associated User" (attribute type User) for the asset objects (for example, from an assets objects custom field with multiple objects), e.g: 557058:13380c58-4287-4135-9e04-4edec2fafebc,557058:5ed8d5af-b3a8-47dc-9933-b1a815a6cf92,557058:16adef20-023f-44f6-a02c-208f1b6dd736 For the User attribute type, Atlassian account IDs are returned. |
Additional information
Parameters used in this function
|
Parameter |
Input (data type) |
Description |
|---|---|---|
|
|
text LIST |
Any valid text list containing asset object keys. |
|
attributeId |
text |
Text containing a valid asset object attribute ID. |
|
attributeName |
text |
Text containing a valid asset object attribute name. |
Output
This function returns a text LIST
(books) Use cases and examples
| Use case | JWT feature | Workflow function | Parser functions | Complexity |
|---|---|---|---|---|
| Send an email to the project lead for a system managed in Jira Service Management Assets |
|
|||
| Automating annual access review for company software in assets |
|