We have a custom field called Milestone that is a "Version Picker (multiple versions)" field. We want to set up an automation rule so that whenever the Milestone field is edited, the Fix Versions field is updated to match it.
Using the Edit Issue action, passing in {{issue.milestone.first.name}} works fine, as does {{issue.milestone.last.name}} -- but using {{issue.milestone.get(0).name}} (or any other value for get() ) does not. Trying to pass in {{#issue.milestone}}{{name}}{{/issue.milestone}} does not work, so that's not an easy way to get all of the values copied over.
I've tried using the advanced Additional Fields section, but I've had no luck.
{
"fields": {
"fixVersions": [
{{#issue.milestone}}
{"name" : "{{name}}"} {{^last}}, {{/last}}
{{/issue.milestone}}
]
}
}
When I try to use the above, I get an error because the curly braces from the smart values make the JSON parser think the syntax is bad:
"Error parsing fields JSON: SyntaxError: Unexpected token { in JSON at position 38"
{
"fields": {
"fixVersions": [
{"name" : "{{#issue.milestone}}{{name}}{{^last}}" },
{"name" : "{{/last}}{{/issue.milestone}}" }
]
}
}
The uglier attempt above should also properly form the JSON we need to add every version from Milestone to Fix Versions, while itself being syntactically correct JSON. However, while I'm able to save the action, but when I try to publish the rule, I get the following error:
"Error while parsing smart values."
I don't know what I'm doing wrong -- the smart values seem to parse correctly when I put that same text into the Description field. Does anyone have any idea on how to fix this? Or a better way to copy all versions from one field to another?
Just to update this issue - we know support copy values between different fields:
Hope this is what you were after.
Cheers,
Nick
Hi Jeremy,
I just want to verify that if you're in server, that you've installed the latest version of Automation. We added the '.get' and '.getFromEnd' functions this week, so there's a good chance they're not working because you don't have them yet.
Unfortunately, the workaround you've chosen for now is the only way to copy a multi-select field into another one. Due to some complications with deep-copying of arrays/objects, you can't use syntax like:
{
"fields": {
"fixVersions": "{{issue.customfield_10034}}"
}
}
I've linked you into AUT-236 on our public issue tracker, where you can watch this issue. When it's resolved, we'll post an update to this thread to let you know it's been fixed (might be some time).
Let me know if you have any more questions!
Huw
Intern at Code Barrel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have a similar problems but it could be caused from the specific multi-value custom field. Is the following approach correct to copy the whole list of parameters set in a parent issue?
{
"fields": {
"customfield_10501": "{{issue.customfield_10501}}"
}
}
Also, a "loop-over-something" feature could be a great improvement!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline 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.