Possibility to set group picker in post function based on user?

Christoph Schmitz January 4, 2021

Hello,

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)

 

Best regards

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 4, 2021

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!

Suggest an answer

Log in or Sign up to answer