Hello Community,
I would like to hide the "bugdet info" tab(2) for people who don't have the administrators role.
I made this script , i put it in Initialiser function behaviours scriptrunner.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.roles.ProjectRoleManager
import com.onresolve.jira.groovy.user.FieldBehavioursdef
projectRoleManager = ComponentAccessor.getComponent(ProjectRoleManager)
def user = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()
def project = underlyingIssue.getProjectObject()
log.warn("project: "+ project)
//Get Current User
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
log.warn("currentUser: "+ currentUser)
def role = projectRoleManager.getProjectRole("Administrators")
log.warn("role: "+ role)
def roleproj = projectRoleManager.isUserInProjectRole(currentUser, role, project)
log.warn("roleproj: "+ roleproj)
if (projectRoleManager.isUserInProjectRole(currentUser, role, project)){
showTab(2)
log.warn("switchTab('Infos Budget'): "+ switchTab(2))
} else{
hideTab(2)
log.warn("hideTab('Infos Budget'): "+ switchTab(2))
//disableTab(1)
//switchTab(2)
}
my problem this script work only in edit screen and not in create screen.
can you please correct this script community, i need your help.
Thanks
BR
Fayçal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.