Remove an Assets object from a multi-select attribute using Jira Automation
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
Purpose
This knowledge base article explains how to remove a specific Assets object from a multi-select Assets attribute in Jira Cloud using Jira Automation. It is based on the provided Automation Rule export and refines the approach into a resilient, reusable pattern.
This article provides a workaround for removing a specific object from an Assets object attribute that allows multiple values (cardinality > 1) using Jira Automation. Currently, Jira Automation does not have a native "remove" action for Assets attributes, so this process involves capturing the current attribute values, filtering out the target object key, looking up the remaining objects, and updating the attribute with the cleaned list.
Cause
Jira Automation does not currently support direct removal or "un-linking" of specific objects from a multi-select Assets attribute. Action steps like Edit object or Edit Assets field attributes typically overwrite the entire list rather than modifying individual entries. This is a feature request tracked on:
Solution
To remove a specific object from a multi-select attribute, the automation rule must:
Retrieve the current list of object keys in the attribute
Remove the target key from that list using string manipulation
Clean the resulting string (trim whitespace, remove empty values, deduplicate)
Look up the remaining object keys to resolve them back to proper Assets objects
Update the attribute with the resolved objects
This approach is more robust than simple string replacement alone, as it handles edge cases like the target key appearing at the beginning, middle, or end of the list, as well as leftover whitespace and empty entries.
Step 1: Branch to the related Assets object
Use a Branch rule / related Assets objects action to scope the automation to the relevant Assets object whose attribute you want to modify.
Add the Branch rule / related Assets objects component.
Configure the AQL (Assets Query Language) to find the object. For example:
Key = {{issue.Assets}} and ObjectType = "Your Object Type"Replace
{{issue.Assets}}with the appropriate smart value for your Assets custom field, and"Your Object Type"with the relevant object type name.
All subsequent steps run inside this branch, in the context of the matched Assets object.
Step 2: Capture the current attribute value
Create a variable to store the current list of object keys in the multi-select attribute.
Add the Create variable action inside the branch.
Set Variable name to
objListSet Smart value to:
{{object.AttributeName}}Replace
AttributeNamewith the name of the multi-select Assets attribute you want to modify (e.g.,LinkedLaptop).
This captures the current comma-separated list of object keys (e.g., IT-41, IT-44, IT-45).
Tip: Add a Log action with {{objList}} after this step to verify the captured value during testing.
Step 3: Remove the target key and clean the list
Before passing it to the string manipulation chain. Create a new variable that will present the object to be removed. On this example we’ll use the object set on a second Asset Object custom field, which is the one to be removed from the {{objList}} created previously, however you may also use static values if desired:
Add the Create variable action.
Set Variable name to
toRemoveSet Smart value to:
({{issue.customfield_XXXXX.key}})
It is recommended to use the custom field ID (e.g., customfield_XXXXX) rather than the field name to avoid errors if duplicate field names exist. To confirm the field ID, you may follow the steps here.
Create a second variable that removes the unwanted object key and cleans up the resulting string.
Add the Create variable action.
Set Variable name to
trimmedListSet Smart value to:
{{objList.replace(toRemove, "").split(",").trim.match("(.++)").distinct}}
There were some scenarios identified where the .trim() function had to be used on the toRemove variable to work as a string, so this would result on the following change to the above:
{{objList.replace(toRemove.trim(), "").split(",").trim.match("(.++)").distinct}}This smart value chain performs the following operations:
Function | Purpose |
|---|---|
| Removes the target object key from the string |
| Splits the comma-separated string into a list |
| Removes leading and trailing whitespace from each entry |
| Filters out any empty strings caused by the removal (uses possessive regex to match only non-empty values) |
| Removes any duplicate entries |
Tip: Add a Log action with {{trimmedList}} after this step to verify the cleaned list during testing.
Step 4: Look up the remaining objects
Use the Lookup objects action to resolve the cleaned list of keys back into proper Assets object references. This is critical — Assets attributes require actual object references, not plain text strings.
Add the Lookup objects action.
Select your Assets workspace and schema.
Set Variable name to
lookupObjectsSet the IQL query to:
Key in ({{trimmedList}})
This retrieves the full Assets objects for all remaining keys in the cleaned list.
Step 5: Update the Assets attribute
Finally, update the attribute on the original object with the resolved list of objects.
Add the Edit object attributes action.
Select the attribute you want to modify (e.g.,
LinkedLaptop).Set the value to:
{{lookupObjects}}
This overwrites the attribute with only the objects that were not removed, effectively completing the removal.
Important notes
Log actions for debugging: Include Log actions after the variable creation steps during development and testing. These let you inspect intermediate values in the automation rule's audit log. You can remove or disable them once the rule is working correctly.
Manual trigger for testing: During development, use a Manual trigger so you can run the rule on demand from an issue. Once validated, switch to the appropriate automated trigger (e.g., field value changed, scheduled, etc.).
Dynamic target keys can also be replaced with hardcoded key (e.g.,
"IT-44")Possessive regex
.match("(.++)"): The(.++)pattern is a possessive quantifier that matches one or more characters. It effectively filters out empty strings that may result from the.replace()and.split()operations, preventing errors in the subsequent Lookup Objects step.
Was this helpful?