Restrict view of certain issue fields

Deleted user December 23, 2019

Hi !

I would like to restrict the time tracker field to only some of my project team members. Is there any way to customize view access of fields within an issue?

1 answer

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

Hi Nair,

If your trying to restrict view access for some members in your team, this can be done with the help of "behavior script using Script Runner". This code will look for the restricted group field, and the user in the group can only view. With the help of Script  Runner plugin this can be achieved.

Code:

import com.atlassian.jira.component.ComponentAccessor

import com.atlassian.jira.user.util.UserUtil

 

// Get pointers to the custom field(s) required

def cf = getFieldByName("Demo Text Field")

 

// Get the current logged in user

def user = ComponentAccessor.getJiraAuthenticationContext().getUser().name

 

// Get a pointer to the resticted fields group

UserUtil userUtil = ComponentAccessor.getUserUtil()

def group =  userUtil.getGroupObject("restricted-fields")

 

// By default hide the field(s) from all users

    cf.setHidden(true)

 

if(userUtil.getGroupsForUser(user).contains(group)){

 // If the user is in the restricted groups field then show the field(s)

    cf.setHidden(false)

}

Or

If you are trying to restrict view access for certain status of the issue, this can be done with the help of  "workflow condition". 

Add the required users to a group and provide a condition.

 

Regards,

Ganesh 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events