I am looking for a way to restrict the creation of one issue type (available across all projects) to members of only one Active Directory group.
From other threads, it looks like the best option may be to write a groovy script validator on the Create action that checks the user's group membership before creating the issue. Two questions:
1) Is there a way to hide the issue type from the dropdown so that users not in that one group can't even see it as an option?
2) If not and the workflow validator is the best mechanism, can you provide sample code for achieving this? I am just learning Java and Groovy, and this is the first script I would be writing. This is what I have so far (which runs successfully, but I'm not sure if it will achieve what I want.
):
import com.atlassian.jira.component.ComponentAccessor
def groupManager = ComponentAccessor.getGroupManager()
groupManager.isUserInGroup(issue.reporter?.name, '<groupname>')
Thanks!