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

Custom buttons in the JIRA top navigation bar stopped working after upgrade to JIRA 6.4

Mairaj Malik April 28, 2015
We have the below code for two buttons in the system-top-navigation-plugin.xml file:

<web-section key="my_links_section_docs" name="My Links Main Section" location="my_links_link" weight="10"/>
       <web-item key="my_links_docs" name="Link on My Links Main Section" section="system.top.navigation.bar" weight="47">
         <label>Docs</label>
         <link href="my_links_docs">/docs</link>
       </web-item>
 
 
<web-section key="my_links_section_issues" name="My Links Main Section" location="my_links_link" weight="10"/>
      <web-item key="my_links_source" name="Link on My Links Main Section" section="system.top.navigation.bar" weight="47">
         <label>Source</label>
         <link href="my_links_source">/source</link>
       </web-item>
These buttons are supposed to point to different links depending on what page we are currently on. This functionality worked fine on JIRA 6.1, but seems broken after upgrade to 6.4.
I still see the buttons in the header after upgrade to JIRA 6.4, but the header.jsp file that handles the logic for how the buttons should behave does not not seem to be triggered at all (as the buttons point to the same link regardless of what page we're on).
Appreciate any help around this...

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Volodymyr Krupach
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 28, 2015

Hi Mairaj!

I had the same problem with my custom plugin that worked under JIRA 6.1 and did not work under 6.3. Do not remember how I resolved it but it was something connected with location of the section. In your sample I do not see where is my_links_link location that you have in the web-section tags. Do you really need web-sections if you add direct links to the top bar?

Here is my XML that adds top menu with one submenu. in my sample last web-item has empty link since the plugin is triggered by javascript onclick for "add-myplugin-project-trigger" class:

&lt;!-- menu --&gt;
  &lt;web-item key="my-plugin-top-menu" name="my-plugin-top-menu" section="system.top.navigation.bar"
    weight="47"&gt;
    &lt;label key="menu.myplugin.section" /&gt;
    &lt;link linkId="my-plugin-top-menu-link" /&gt;
  &lt;/web-item&gt;
  &lt;web-section key="my-plugin-menu-section" name="my-plugin-menu-section" location="my-plugin-top-menu-link"
    weight="10"&gt;
  &lt;/web-section&gt;
  &lt;web-item key="my-plugin-menu-item" name="my-plugin-menu-item"
    section="my-plugin-top-menu-link/my-plugin-menu-section" weight="10"&gt;
    &lt;label key="menu.myplugin.name" /&gt;
    &lt;tooltip key="menu.myplugin.label" /&gt;
    &lt;link /&gt;
    &lt;styleClass&gt;add-myplugin-project-trigger&lt;/styleClass&gt;
  &lt;/web-item&gt;
Mairaj Malik April 28, 2015

Hi Volodymyr - Thanks for the response! I tried removing the web-sections and just leaving the links as web-items as you said. But I got the same result... So now I don't have the web-section tags anymore: <web-item key="my_links_docs" name="Link on My Links Main Section" section="system.top.navigation.bar" weight="47"> <label>Docs</label> <link href="my_links_docs">/docs</link> </web-item> <web-item key="my_links_source" name="Link on My Links Main Section" section="system.top.navigation.bar" weight="47"> <label>Source</label> <link href="my_links_source">/source</link> </web-item> Any other ideas? Could I possibly use a similar implementation as yours to leave the link tag empty and use the styleClass to call my javascript? My javascript is currently in header.jsp btw which is at the following location <>/webapp/includes/decorators/aui-layout/header.jsp. Appreciate your help

Volodymyr Krupach
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 28, 2015

Hi Mairaj! Try adding linkId to your links (I looked to the stash and see that I added it when fixing menu problem). If that does not help and you are fine to have submenus under the top menu (BTW you can move booth links under one top menu), you can change your plugin based on sample I posted. You do need to change your implementation and use styleClass for triggering your code. I did so because I needed to show a dialog above the current page and you have separate pages. So just add href to the menu-entry webitem and remove styleClass. Please update us with your results.

Mairaj Malik April 29, 2015

Hi Volodymyr - Using the linkID worked for me! Thanks a lot for your help and suggestions :) Really appreciate it...

Volodymyr Krupach
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 29, 2015

My pleasure :-)

TAGS
AUG Leaders

Atlassian Community Events