I’m trying to build an automation rule in Jira Cloud that removes an object attribute (application) from a multi-object attribute (field type: Assets object attribute) in the Employees object type.
Context
Schema: Staff
Object Type: Employees
Attribute: Applications (multi-object, references the Applications object type)
We already have a working rule that adds applications using a structure like:
Now, I want to remove a specific Application (e.g., APP-17) from an employee’s list of Applications when a sub-task is created (used for access revocation).
What I Tried
Using variables allApps, filteredApps and appToRemove:
appToRemove
{{issue.customfield_10629.key}}
allApps
{{object.Applications.key.join(",")}}
filteredApps
{{allApps.replace(", ",",")
.replace("[","")
.replace("]","")
.replace(appToRemove, "")
.replace(",,", ",")
.trim(",")}}
Then passing it into the Edit Object action like this:
[ {{#filteredApps}} { "key": "{{.}}" }{{^last}},{{/}} {{/filteredApps}} ]
But it doesn't work.. any help is appreciated.
Fabio