The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Hide specific fields/parts of the view screen

Harry Pieterse
March 25, 2020

Hi All,

I'm new to scriptrunner and what I'm trying to achieve is to hide specific parts (like side-bar-panel) and some fields like reporter, watchers and so on to get the minimal information necessary for a user to perform tasks on an issue.

I'm trying to do that with scriptrunner's fragment>
So far I've code like

import com.atlassian.jira.component.ComponentAccessor

def user = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()
def UserInTeam = ComponentAccessor.getGroupManager().isUserInGroup(user, "Team A")
def IsCompliancyProject = (issue.getKey()=="COM")

if ( IsCompliancyProject ) {
if ( !(UserInTeam) ) {
false;
}
else {
true
}
}
else {
true;
}

The goal is to hide specific items only when the current user is not member of the "Team A" and the current issue belongs to project "COM".
What I'm not getting fixed is the check on the issue that is selected by the user.
The code above checks if the project exists (and it does) so only differentiates for the user membership.

How can I create a check that validated the issue's project-key.

thanks for all your answer

Kind regards

 

Harry Pieterse

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question