Why my javascript plugin makes all the general menus disappear?

Hung Nguyen February 27, 2015

Hi,

I have a custom field which have some javascript going with it. The custom field existed in some issue screens only. If I put the javascript in the Description of the custom field, then it works correctly but with the same problem described by Jannik Luyten here (https://answers.atlassian.com/questions/169911)

My javascript is very similar to what Jannik Luyten used, so I tried his solution (without Velocity change):

  • Create a javascript plugin, with similar atlassian-plugin.xml, context atl.general
  • Move the javascript from custom field description into the javascript.js referred to by my plug-in
  • package the plugin and install it into my jira

After installation, clicking on the Create Issue I could see my javascript run. But then all the main menu of Dashboard, Project, Issues at the top banner are not functioning anymore. The only working option is login out and admin.

In my javascript, I tried to check to only do the work if my custom field exists, but it doesn't help.

What should be the correct way to avoid this?

Thanks

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Hung Nguyen February 27, 2015

I guess that it's because I used the default name "javascript.js", generated by the template.

<web-resource key="module-js" name="Module javascript">
  <dependency>com.atlassian.auiplugin:ajs</dependency>

  <resource type="download" name="my-js.js" location="/js/my-js.js"/>

  <context>atl.general</context>

</web-resource>

 

After I changed the name to my-js.js, then it works.

 

TAGS
AUG Leaders

Atlassian Community Events