I am running Jira server 8.7.1, and I just picked up the Automation for Jira - Server app from the marketplace. It seems like a very useful tool!
Right now I am trying to use it to revert any change to a number of fields in certain circumstances (i.e. based on the value of another field and the user being in a group or not).
I have written a rule with a "Field value changed" trigger, added the conditions I want, and have an "Edit issue" action.
I have been able to use this rule to revert the value of a single hard-coded field using {{fieldChange.fromString}}. I was also able to revert that same field by using the "Additional fields" box with the following JSON:
{"fields": {"Coding Developer": "{{fieldChange.fromString}}" } }
While I could write a rule for every single field I want protected, I'd much rather cover them all with this one rule. It seems like it should be possible just by changing the JSON to this:
{"fields": {"{{fieldChange.field}}": "{{fieldChange.fromString}}" } }
I have verified that {{fieldChange.field}} outputs the name of the field correctly when used to write to the audit log or send notification emails. But when I put it in the Edit Issue JSON box, I get this error message:
"Additional fields contains invalid field(s) in 'update' or 'fields' section: {{fieldChange.field}}"
If anyone has any recommendations for how I can use {{fieldChange.field}} in the JSON box, or a suggestion for a different way to accomplish what I want to do, I'd very much appreciate your assistance. Thank you!