Hi Guys,
I'm creating an automation that when a value is changed it is updated in another issue that is linked.
However, the field is an Insight object and it does not appear in the list of available fields, I am using the advanced session and I receive an error message Data was not an array
This is my code
{
"fields": {
"customfield_XXXX":"{{triggerIssue.fields.customfield_XXXXX}}"
}
}
Can someone help me?
BR,
Fabio
WELL. This was a journey.
As you discovered, @Fabio Manzoni for some reason Asset object custom fields apparently no longer show up in the Edit Fields action. I don't know if this is a change from Insight being an add-on to now being integrated with JSM Premium but for whatever reason, these instructions DO NOT WORK:
Instead, you were right - this required Additional Fields (formatted in JSON), and I had to do a bunch of digging.
First off, you're going to need to do a Lookup objects to find the objects with your current issue:
object HAVING connectedTickets(key={{issue.key}})
That returns all objects connected to your ticket as a list. So then, using list operators, you can construct an array object. But hold on, you first need your Assets Workspace Id. I found this by going to:
https://MYSITE.atlassian.net/rest/servicedeskapi/assets/workspace
You need that Workspace ID because you'll need it for the JSON, as per this excellent reference: JSON input for fields (I took a wild guess that the long string was a Workspace Id)
So then, For Linked issues, I am Editing each one and this is what I'm putting into Additional fields:
{
"fields": {
"My Asset": [
{{#lookupObjects}}{"id": "MYWORKSPACEID:{{id}}"}{{^last}},{{/}}{{/}}
]
}
}
(Where my Asset object field is named "My Asset")
(OOOOF, after I dug all this info up myself, I found this KB article that has a little information about the change: Workarounds to automatically link the Asset object to Jira issues)
What's really odd is that last link is specifically talking about the "new" Assets in JSM, and makes it seem like the easier solution (just doing an Edit issue in Automation) ought to work:
But in my testing, I could not see my Asset object custom field available for editing in Automation.
@Grady Gausman or @Charlotte Nicolaou - since you've posted about Assets and Insights before, I'm wondering if you might know anything about this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, figured it out, thanks to opening a Support ticket and getting help from @Lucas Silva !
Even though my rule had a manual trigger, it was only scoped for a Single Project, and I guess Automation thought I might be trying to copy it to another project, per this KB article:
So to get the Asset field to show up for regular editing, I had to make my rule Global.
I was then able to create this much simpler rule:
Your trigger, I assume, would be if the "My Asset" field is changed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually now that I've played with it, you probably want to just:
Copy YOUR FIELD from Current Issue
Like so:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One caveat is that both using SET and COPY appear to add assets to the linked issue, but not REMOVE any.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did your steps a few times and it showed a success message, but the issue was not edited.
I tried another approach and worked.
It so happens that my insight field (assets) is used in software and service management projects. And the copying of the values occurs exactly between these types of project and that's reason that the field doens't appear.
To solve it, I set the automation to Global, so my field started to appear in the edit issue.
Once the configuration was done, I returned my automation to Multi-project and selected my projects. With that it worked normally.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Fabio Manzoni --
According to this KB article, there is a separate Automation action for Editing Objects - you don't edit it as a field:
Update object attribute values using automation with JSM Assets
There's also links to several examples.
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.
Hi @Darryl Lee
Thank you for your answer, but in my case I need to update a issue value. The documentation cannot help me.
Example that I need.
issue 1 the value is Database
issue 2 the valueis empty
Both issues are linked then I need to copie the value Database to issue 2.
BR,
Fabio
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.