is it possible to set a group picker in a post function based on the user who transitions the issue?
I want to do the following:
Users can set the status to "investigating" and have to set the group picker "team" to the according team group manually so the members of that group see that there is an issue they have to work on.
The other way would be, a user takes the issue directly and does not pass the issue to a team. Therefore he uses the "fast-track" transition where he gets set as assignee directly in a post function. Problem is - for reporting - we need the according team group of the user who directly assigns the issue to himself to be set too. Can I script this? I dont know how to check (user A assigns himself the issue -> search his profile for relevant groups -> if there is a group starting with "Team...." set it)
If you have Scriptrunner, then combining bits of these two scripts should do the job:
https://library.adaptavist.com/entity/identify-the-groups-of-a-user will get a list of groups for the currently logged in user.
https://library.adaptavist.com/entity/update-the-value-of-custom-fields-through-the-script-console shows you how to set values of many types of field on an issue, so nick the group-picker lines from that!
Catch up with Atlassian Product Managers in our 2020 Demo Den round-up! From Advanced Roadmaps to Code in Jira to Next-Gen Workflows, check out the videos below to help up-level your work in the new ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events