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
Community moderators have prevented the ability to post new answers.
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.
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, I am using somthing like int[] tmpJiraVersionNumber = buildUtilsInfo.getVersionNumbers(); if ( tmpJiraVersionNumber.length >= 2 && tmpJiraVersionNumber[0] >= 6 && tmpJiraVersionNumber[1] >= 4){...} else {...}.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I look in JIRA 6.4 source for DarkFeatureEnabledCondition I do not find anything...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
See my answer here: https://answers.atlassian.com/questions/14195565/answers/23068684 - I think it needs to be "conditions" : [] not "condition"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.