Please propose a solution to the following problem, or provide a sample automation for populating an asset into an asset-type field.
What I want to do
Objective: I want to automatically set the relevant object in the "Personnel" field (asset type) of an issue.
Current operation flow
Manually trigger the automation
Search Assets (lookupObjects) for an object with the same name as the summary of the triggered issue
Edit the work item field
Insert the obtained object into the empty asset-type field.
Current issues
Searching and retrieving the object works correctly (confirmed via comment output)
However, I cannot automatically set the object in the asset-type "Personnel" field, and an error occurs
What I have tried so far
Granted the Assets schema permission to the automation rule
Confirmed via comments that the intended object is being retrieved
Automation screen
Asset-type field settings
Hey @田中優貴
From what i can see in the pics, here is what i believe is set up correctly
Why it fails
You have two options:
Option 1: Advanced JSON (recommended)
In the Edit work item → More options, use:
{ "fields": { "customfield_XXXXX": [ { "id": "<<workspaceId>>:{{lookupObjects.get(0).id}}" } ] } }
{ "fields": { "customfield_XXXXX": [ {{#lookupObjects}} { "id": "<<workspaceId>>:{{id}}" }{{^last}},{{/last}} {{/lookupObjects}} ] } } |
Option 2: AQL in Edit Action
If the field supports AQL input, use:
Key = "{{lookupObjects.get(0).Key}}" |
This works only if the field allows AQL assignment.
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.