Need to hide a feild on particular project role/group

Faiza Kazmi April 22, 2019

i want to hide a field for a group named as reviewer like he should not view the field while creation,editing and view

2 answers

1 vote
Faiza Kazmi April 22, 2019

i have installed the behavior script runner  plugin but it didn't work my me.my jira version is 7.0 and script runner version is 5.1.6.2 

0 votes
Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 23, 2019

Hi @Faiza Kazmi ,

Please use this snippet in the behaviours Initializer : 

import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
import com.atlassian.jira.component.ComponentAccessor

@BaseScript FieldBehaviours fieldBehaviours

def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def groupManager = ComponentAccessor.getGroupManager()
def yourField = getFieldById("customfield_11011")

yourField.setHidden(!groupManager.getUsersInGroup("reviewer").contains(currentUser))

Antoine

Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 9, 2019

Hi @Faiza Kazmi , did that work for you ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events