-
Suggestion
-
Resolution: Unresolved
-
3
-
Background
Referencing an Assets custom field following a trigger for an issue created event behaves different to when an Assets custom field is called in a trigger where an existing issue is edited, such as Field value change configured with Edit issue.
One such example is the {{addedfieldChange.values}} smart value (see the documentation on the fieldChange smart value for further information).
However this smart value behaves different depending on the trigger configuration. When an Assets custom field triggers the Edit issue configuration, the value is represented as the object label. An example can be seen below:
However, using the Create issue configuration, instead of the object label, the system uses a JSON payload of the Assets workspace id and the object id:
The ask
Ideally both trigger configurations should work in the same way and should be consistent.
Workaround
Within the rule a few additional components can be added to retrieve the desired object data:
- Create a variable that we can call objectId
- For the variable smart value section we can use match() to extract the object id value: {{addedfieldChange.values.match(".*objectId=(\d+)")}}
- Using the Lookup objects action, we can retrieve the object using the following AQL: objectId = {{objectId}}
- We can now access the object data in the automation rule via {{lookupObjects}}
It is not only addedfieldChange.values affected. But all properties of addedfieldChange.
Issue Create / addedFieldChange:
FieldValueDifference{field=customfield_10165, fieldType=, fieldId=customfield_10165, valueIds=[
{workspaceId=removed, id=removed objectId=removed]}, values=[\{workspaceId=removedremoved, objectId=removed}]}
Issue Update / addedFieldChange:
FieldValueDifference{field=Business Service, fieldType=null, fieldId=com.atlassian.jira.plugins.cmdb:cmdb-object-cftype, valueIds=[globalIdremoved], values=[some asst name]}
—
This makes working with this smart variable inconsistent and possibly unreliable. Please fix this bug... This should not be considered a suggestion / feature request!