Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to disable Project Tab Panel for new JIRA project-centric view in JIRA 6.4

Holger Schimanski March 20, 2015

JIRA 6.4 introduces a new project-centric view in JIRA. The Project Tab Panel is replaced by a Side-bar Entry as described here. For backwards compatibility Project Tab Panels are shown in a Add-ons section.

I have now implemented a new sidebar entry for my plugin and now want to deactivate this Add-ons entry for the project tab without completely removing the tab for users or instances which uses the old project dashboard.

Is there any kind of new condition for the project tab panel? Or how to solve this problem?

Best regards, Holger

Bildschirmfoto 2015-03-21 um 06.37.48.png

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Igor Sereda [ALM Works]
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.
April 23, 2015

In our P2 plugin we had to write our own check in ProjectTabPanel.showPanel(). It checks different feature keys and JIRA version:

private final FeatureManager myFeatureManager; // injected in constructor
...
public boolean showPanel(BrowseContext ctx) {
  ApplicationUser auser = ApplicationUsers.from(ctx.getUser());
  boolean jira64 = Util.getJiraVersionSignature() >= 60400; // this method uses BuildUtilsInfo to get JIRA version
  boolean projectNavEnabled;
  if (jira64) {
    // In JIRA 6.4 it is enabled by default
    projectNavEnabled = !myFeatureManager.isEnabledForUser(auser, "com.atlassian.jira.projects.ProjectCentricNavigation.Disabled");
  } else {
    projectNavEnabled = myFeatureManager.isEnabledForUser(auser, "com.atlassian.jira.projects.ProjectCentricNavigation");
  }
  if (projectNavEnabled) {
    // panel rendered through web-item
    return false;
  }
  ... other conditions
}

 

It would have been great if Atlassian had thought about plugins supporting both old and new project navigation and offered a single API function, so we don't have to dig through all the possible sources to find an answer to a simple question - is project-centric navigation enabled or not.

Holger Schimanski
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.
April 27, 2015

Many thanks for sharing! One question regarding JIRA version. BuildUtilsInfo has only getVersion (String) or getVersionNumbers (int[]) but not getJiraVersionSignature. At least in JIRA 6.2 API...

Igor Sereda [ALM Works]
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.
April 27, 2015

Yeah, that's our own method that converts JIRA version 6.4.0 to "60400" (major*10000 + minor*100 + micro). Just to make version comparison easier. You can implement the same method or compare against getVersionNumbers() result.

Holger Schimanski
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.
April 27, 2015

Okay, I am using somthing like int[] tmpJiraVersionNumber = buildUtilsInfo.getVersionNumbers(); if ( tmpJiraVersionNumber.length >= 2 && tmpJiraVersionNumber[0] >= 6 && tmpJiraVersionNumber[1] >= 4){...} else {...}.

2 votes
filiprogaczewski
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.
March 26, 2015

You can add the following condition to your Connect

 "condition": {
    "condition": "feature_flag",
    "invert": false, 
    "params": {
       "featureKey":  "com.atlassian.jira.projects.ProjectCentricNavigation"
    } 
  }

 

or P2

<condition class="com.atlassian.sal.api.features.DarkFeatureEnabledCondition">
   <param name="featureKey">com.atlassian.jira.projects.ProjectCentricNavigation</param>
</condition>

modules

Holger Schimanski
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.
March 26, 2015

I have a P2 plugin. Adding this as a condition to <project-tabpanel> seems to have no effect. Any idea? See https://bitbucket.org/hski/projectroletab-public/src/3ac10ccd6be128dc2c05f983ceaa96a3317be1ff/src/main/resources/atlassian-plugin.xml?at=master

Holger Schimanski
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.
March 26, 2015

If I look in JIRA 6.4 source for DarkFeatureEnabledCondition I do not find anything...

0 votes
Yves YANG
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.
June 3, 2015
This condition doesn't work. 
"condition": {
    "condition": "feature_flag",
    "invert": false, 
    "params": {
       "featureKey":  "com.atlassian.jira.projects.ProjectCentricNavigation"
    } 
  }

when the option Project navigation is disabled, the addon project tab doesn't show up. 

James Hazelwood
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 2, 2015

See my answer here: https://answers.atlassian.com/questions/14195565/answers/23068684 - I think it needs to be "conditions" : [] not "condition"

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events