Hi everyone,
I'm hoping someone can help me with a strange issue I'm facing in a JSM automation rule.
My Goal: I'm trying to get the value of a custom Assets attribute named ID
and copy it to another field.
The Problem: When I use the smart value {{object.attributes.ID}}
, it doesn't return the attribute's actual content. Instead, it returns a string of internal system IDs, like 207, 210, 407, ...
.
What I've Tested: I set up a Log Action to see what different smart values return, and the results are very confusing:
{{object.attributes.ID}}
Result: [207, 210, 407, 409, 177, 179, 180]
(The incorrect string of system IDs)
{{object.ID}}
Result: [7219]
(This correctly gets the object's Jira Key ID, but not the value of my custom attribute)
{{object.attributes.get("ID")}}
Result: []
(Returns an empty value)
It seems like there might be a naming conflict between my custom attribute named ID
and the built-in {{object.ID}}
property, but I can't be sure.
My Question:
Has anyone seen this behavior before or found a smart value syntax that can correctly get the value from an attribute specifically named ID
?
My only idea for a workaround is to rename the attribute to something like "Source ID", but I'm really hoping to avoid that as it will require updating several of our import mappings.
Is there another solution I might be missing?
Hello @Jakob Lindström
You cant use an Attribute named ID in asset management as the ID is a system field in the assets to look for the object.
You will have to change the attribute name.
Very frustrating but true! Every attribute in Assets should have a logical name and a display name so that it's easier to create attributes that may have a similar display name, or you don't need to worry about changing the name of a field and breaking everything associated with it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.