Hi everyone,
I'm stuck trying to update an "Assets Objects" custom field using Global Automation (Jira Cloud / JSM / Assets) and hoping someone has seen this before.
What I want: When my automation creates a Purchase Order object in Assets (e.g., AST-2700), I want it to link the original Jira issue (e.g., PO-25) back to that new Assets object using a custom field ("Related Purchase Order", ID customfield_XXXXX).
What I'm doing: My rule creates the PO, looks it up, saves the key (AST-2700) into a variable {{purchaseOrderObjectKey}} (I've confirmed this works with logging). Then, I use the Edit issue action with this Advanced JSON:
{
"fields": {
"customfield_XXXXX: [
{ "key": "{{purchaseOrderObjectKey}}" }
]
}
}
The Problem: The automation audit log shows the Edit issue step succeeding ("Issues edited successfully"). BUT, when I look at the Jira issue (PO-25), the "Related Purchase Order" field is still empty! The update just doesn't "stick".
What I've Checked:
The variable {{purchaseOrderObjectKey}} definitely has the right Assets key right before the Edit issue step.
Manual editing of the "Related Purchase Order" field on the issue works perfectly (so the field/AQL config seems fine).
The rule actor is set to Automation for Jira.
I've tried to ensure the Automation for Jira actor has Assets View permissions for the Purchase Order object type via Assets Roles (added Automation for Jira to a relevant role). I think this is correct, but maybe I missed something?
I have also set it as actor ME (admin)
My Question: Why would Edit issue report success but not actually update the field? Has anyone run into this silent failure with Assets fields? Any ideas what else to check, especially if the permissions seem okay? Thanks so much for any help!
Picture of Automation:
Welcome to the community.
On the Edit action, if you select the field instead of the advanced option and set the field value to variable {{purchaseOrderObjectKey}}
or
{
"fields": {
"customfield_XXXXX: { "key": "{{purchaseOrderObjectKey}}" }
}
}
Hi Marc,
Thanks for helping.
I tried to set it without advanced option.
I then get this error:
Unable to retrieve the configuration management database (CMDB) when updating the issue field
Bad Request
Unable to find any issue field values to edit:
PO-41
and unfortunately, the JSON did not work as well.
If I run it with my advanced JSON as before with logging, i get this log:
Create object
Lookup objects
Create variable
Log action
Log
DEBUG: Key for Edit Issue = [AST-2765]
Edit issue04/11/2025, 13:41:56
Issues edited successfully
PO-44
According to the log, everything is fine.
But it does not automatically change in the issue.
I'm starting to wonder if it is even possible? Since the field is using this + sign
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So you lookup provides the assets key right?
Then I was even wrong.
You should be able to edit the issue like this:
In the edit action select the field to be edited (in your case Related Purchase Order)
Then use the smart value: key in {{lookupObjects}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes,
I have tried to use the drop down list instead of the JSON. But it always fails.
I tried using my variable name : {{purchaseOrderObjectKey}}
I tried with {{lookupObjects.first.key}}
This is the automation:
https://imgur.com/a/aNMSMwu
This is the details:
https://imgur.com/a/NXXuP6G
This is how it looks and some logs:
https://imgur.com/a/nhhu2Az
And this is how I want it to look:
https://imgur.com/a/cney3Cu
Thank you so much for helping me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should add a re-fetch issue data before editing.
The editing can be done without creating the variable.
In the edit action select the field to be edited (in your case Related Purchase Order)
Then use the smart value: key in {{lookupObjects}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marc,
It just doesn't work.
I've gone thru the documentation multiple times now.
It even says that Issues edited successfully. But still doesn't change
But I can choose it manually.
I've also double checked my permissions and I've tried to run it as Jira Automation or as myself as admin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is you edit action configuration?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've tried with
{
"fields": {
"customfield_10190": [
{ "key": "{{purchaseOrderObjectKey}}" }
]
}
}
(Which says all is good)
And I've tried the following (not advanced)
{{lookupObjects.first.key}}
{{purchaseOrderObjectKey}} (Which I've set as a variable)
{{lookupObjects}} (Which give me error: Unable to retrieve the configuration management database (CMDB) when updating the issue field: Bad Request
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Stop doing the edit like this.
Do the editing like this:
In the edit action select the field to be edited (in your case Related Purchase Order)
Then use the smart value: key in {{lookupObjects}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Omg.
I'm so stupid. I was positive that i've already tried that.
But obviously not.
Thanks a lot @Marc - Devoteam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Jakob Lindström
Welcome to the Atlassian community.
What is the custom field type "customfield_XXXXX"?
The attribute "key" may not be applicable to the custom field depending on what type of field it is.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Trudy,
It is type Assets objects (Advanced custom field)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.