My client wants to restrict item creation to people of two teams.
Due to the circumstances I can't work with simple permissions.
The client is using scriptrunner for other projects; So my initial thought was to leverage that.
By using a simple scripted validator in the "create" transition I want to check whether the current user is part of group a or group b, if it validates to true, the item can be created.
I am a total groovy script noob, so naturally I've done some digging and came up with the following groovy "script":
import com.atlassian. jira.components.ComponentAccessor
if(ComponentAccessor.getGroupManager().isUserInGroup(currentUser, "group name a")){}
else if(ComponentAccessor.getGroupManager().isUserInGroup(currentUser, "group name b")) {}
Which does not work.
Regardless of it working as intended or not, it also doesn't display the error message I provided in the ssv.
What am I doing wrong? Is there a better solution, do I just need to adjust the script?