how to validate a users in a particular group in jira using groovy

Pantham Akhil July 14, 2021

Hi all,

we have 5 users in Jira-admins group so we don't want add any add any other user to that group, if any user accidentally added to that group then an eamil has to be sent to me or my manager that new user added to that admins group. can any one help me to write a groovy script please. thanks in advance

1 answer

0 votes
Tom Lister
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 6, 2021

Hi @Pantham Akhil 

If you have scriptrunner you could look into setting up a Listener on event GroupMembershipCreatedEvent.

There is a listener template to send custom emails.

You can validate which group is affected

import com.atlassian.crowd.event.group.GroupMembershipCreatedEvent
if (event.getGroupName().compareTo("jira-administrators") == 0) {
true
} else {
false
}

Suggest an answer

Log in or Sign up to answer