Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I restrict currentUser in a specific group?

Teja October 4, 2016

On the close transition button I wanted add validation if the currentuser is in 'QA100' group
prevent user to do the transtion.

else proceed....

How to do that

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

4 votes
Answer accepted
Alexander Richter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2016

if you have the scriptrunner AddOn, you can use a scripted validator

maybe like this:

import com.atlassian.jira.component.ComponentAccessor
def groupManager = ComponentAccessor.getGroupManager()
groupManager.isUserInGroup(currentUser, 'QA100') == false

this should return 'true' if the currentUser is not in the group 'QA100' and the validation will be passed.

 

Another Option would be to use a condition instead of validator.

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.
October 4, 2016

Indeed, a validator is the wrong place for this - you'll give the user an ugly and frustrating error when they try do something.  A condition would hide the transition from them so they'd simply not be able to do it.

Teja October 4, 2016

It worked...Thank you very much Alexander

TAGS
AUG Leaders

Atlassian Community Events