I have "Countries" field that I want to fill based on the reporters group, either when work item is created or the value for reporter has changed and I have to do it with ScriptRunner due to the amount of tickets created and Jira Automation limits. The field must be editable later manually when needed.
I created an event listener for that but I am struggling with making the script work.
I can fill the "Countries" field but right away when I add a condition to check reporters group, i get some errors. This seems such an easy script so I am sure, someone in here could make this work in seconds.
In Jira Automation it is pretty straight forward:
- When field value changes for Reporter
- IF
- Reporter is in group "ExampleGroupA"
- Edit "Countries" to "ExampleCountryA"
- ELSE-IF
- Reporter is in group "ExampleGroupB"
- Edit "Countries" to "ExampleCountryB"
... and so on.