Behaviour plugin create issue screen

Maitrey Patel
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 17, 2018

Code:

if(getActionName() in ["Create Issue", "Create"])
{

 // Create Screen - Show all fields.

changeTypeField.setHidden(false);

}

else

{

  // Any screen - Hide controls.

 changeTypeField.setHidden(true);

}

When I open create issue screen from any other view issue screen it goes to else part for the first time. Then I cancel and click on create button works well, passes if condition. Edit screen works well in all condition. 

So on the first time create issue screen hides controls and second time it shows.

I checked with GetActionName() it returns NULL on the first time and then it returns CREATE on the second time.

 This condition is required as Admins are allowed to edit ChangeType field. 

def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

if(ComponentAccessor.getGroupManager().getGroupsForUser(currentUser)?.find {it.name == "Jira Administrator"})
      return; // No need to perform any action.

2 answers

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 19, 2018

Why don't you just remove the "type" field from the edit screen?

Santhosh Vegolam July 19, 2018

Hello Nic  brough,

One small query regarding Time tracking settings in jira  one user wants for his project default instead of minutes he want hours so using behaviour plugin or through script is it possible?? and kindly  request you to if possible please share the script For time tracking settings edit for the particular project from minutes to hours through Adaptvist scriptrunner also

Thanku so much

Thanks

santhosh 

0 votes
Mark Markov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 19, 2018

Hello @Maitrey Patel
Maybe I misunderstood something
But why you dont want to remove this field from others screens except create?

Maitrey Patel
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 19, 2018

This condition is required as Admins are allowed to edit ChangeType field. 

def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

if(ComponentAccessor.getGroupManager().getGroupsForUser(currentUser)?.find {it.name == "Jira Administrator"})
             return;

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events