I have seen the tutorial to sync a value across issues for a specific field change. Is there a way to have a single automation rule when trying to keep issues in sync for many different fields, say 50, and we don't know which field(s) were updated? I have been researching 'changelog' thinking that could help, but have not been able to figure it out.
Bah, I could've sworn I wrote up a whole answer involving clever smart value variable manipulation, but in the end, ran into the same old same problem that you can't embed/reference/nest smart values inside of other smart values.
I wonder what happened to my answer...
I set a created a variable named changed set to {{changelog}} and then created another variable named changelist and used match() to parse out the list of changed fields:
{{changed.match(".*?field='(.+?)', .*?")}}
But then I tried to use Advanced Field Editing to set the field values to the parent, and that's where I encountered failure:
{
"fields": {
{{#changelist}} "{{.}}": "{{issue.parent.{{.}}" {{^last}}, {{/}} {{/}}
}
}
Resulting error:
Error while rendering additional fields.
Failed to get value for issue.parent.{{.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Improvement filed:
"Possibility to nest smart values in Automation"
https://codebarrel.atlassian.net/browse/AUT-2086
Related questions:
https://community.atlassian.com/t5/Jira-Core-questions/Is-there-a-way-to-concatenate-or-nest-smart-values/qaq-p/1374187
https://community.atlassian.com/t5/Jira-Software-questions/Is-it-possible-to-use-nested-Smart-Values/qaq-p/1423642
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nick Hays
That doesn't seem possible yet. There is a suggestion to copy all changes to linked issues:
https://codebarrel.atlassian.net/browse/AUT-756
Until then, you may want to reconsider how your issues are organized / populated if there is that much information you want duplicated across the levels. Perhaps it may not all be needed at all levels, and you can simplify what is checked and copied.
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oooh, that's a neat idea, and I made some headway, but ultimately failed. :-{
I was able to get the list of fields that had changed by:
But where I got stuck, and where I always seem to get stuck, is that Automation doesn't allow nested or evaluated smart values.
Then I tried this with Advanced Field Editing on all of the subtasks:
{
"fields": {
{{#changelist}} "{{.}}": "{{issue.parent.{{.}}}}"{{^last}}, {{/}} {{/}}
}
}
(Fully recognizing that this will fail for fields that are of list type, etc.)
The idea is that since {{changelist}} is a list, then you can iterate through it with {{#changelist}}, where {{.}} is the current item (name of the field that was changed). So I'm trying to get the value by referencing the field name with: {{issue.parent{{.}}}}
The problem was accurately described by joseba.ercilla@gailen.es what I'm trying to do is use it on a property access:
As he properly explained:
We will need either a way to force inline evaluation, or a getter method equivalent to direct property access...
I finally got a bug filed for this: https://codebarrel.atlassian.net/browse/AUT-2086
But since it's in Codebarrel's repo, there's no way to vote or comment on it. :-{
This has been previously discussed here:
https://community.atlassian.com/t5/Jira-Core-questions/Is-there-a-way-to-concatenate-or-nest-smart-values/qaq-p/1374187
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For the record, here's the error I get:
Error while rendering additional fields.
Failed to get value for issue.parent.{{.
So yeah, it doesn't like that. I don't exactly know the right terminology - eval, nested variable, reference variable, pointer variable. But yeah, I have a few automations where I could really could have used this.
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.