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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.