Hi,
I use "Fragments module off Script Runner add-on to hide time tracking for a specific user role.
My script is well configured but users can still see those two fields when they edit or modify issues
In the "Hide What" Section" : I have set all possibilities :
There is my Script :
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.roles.ProjectRoleManager
//Issue issue = issue
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def roleManager = ComponentAccessor.getComponent(ProjectRoleManager)
def projectRole = roleManager.getProjectRole("Developers")
//if project role Developers does not exist return false
if (!projectRole)
return false
//will return true or false if the user is in DEvelopers role
def isInRole = roleManager.getProjectRoleActors(projectRole, issue.getProjectObject())?.getApplicationUsers()?.contains(user)
return isInRole
Any idea or simple way to do it please ?
I would use behaviours to hide these fields.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.