It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

jira 7 and javascript for web-item

I'm in the process of upgrading a custom plugin we created in order to move into jira 7. The plugin is currently in jira 6.4 and using some now deprecated code, example WebResourceManager.

My issue is I cannot see my custom javascript files in the plugin. I'm building a fresh plugin using the 6.2.14 SDK and jira 7.2. From my understanding this is setting up Spring Scanner and could require me to alter my jspa files and not use WebResourceManager, or even PageBuilderService. But I have researched many solutions and I cannot get the plugin to see or use the javascript files. I have a base plugin set up, similar to Jtricks, but using a

I'm asking for a true, best practice solution for bringing in javascript files to use within a plugin. An example would be amazing as I'm running into issues with my attempts.

Thank you

1 answer

0 votes
Micky CARITTE Community Leader Nov 29, 2017

Hi Brian,

The whole web resources management process is detailed in the documentation here:

If your resources needs to be loaded from a velocity template, the webresourcesmanager seems to be the currently recommended solution. From within a servlet you might want to use PageBuilderService as explained in the above mentioned page.

I also advise you to set a specific context for your resources to avoid loading resources which are not needed in certain modules!

Hope this helps!


Thank you for the assistance. I found a reference that used the PageBuilderService.assembler().resources().requireWebResource().

I have the basics running now. I really think the issue was running multiple javascript files. The original code had web-resources with dependencies to other web-resources. (JS files referencing other JS files basically). Jira did not like it for some reason. I'm going to review it later and see if I can refine them. Currently I have multiple web-resources, all with one JS file each, pointing to the same context. It's not perfect, but running now.

Micky CARITTE Community Leader Nov 30, 2017

Great! Glad you found it out!

You should write your question as answered to help people inthe same situation heading to your answer :)

Have a great day and good luck for your plugin!

Micky - great point.


I found this:

The tutorial focuses on Jira 7. This is a basic, but great tutorial that walks through Webwork, REST, and JS files, something we all need these days. It even goes through some basic testing setups.

I was able to create a web-item that lives in the section, and references the webwork that contains the actions for the input and post velocity pages. Finally I have the web-resource holding the JS file and it launches with the correct pages.

I think the biggest issue was understanding the web-resources and how they work together. I still need to set up dependencies to clean up the code a bit, but I'm getting there.

Micky CARITTE Community Leader Nov 30, 2017

Good! This tutorial was really helpful for me as well as it's detailing many aspects of plugins concept (Active Objects, REST APIs...). The explanations are clear and well done, definitely a good start!

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted Oct 09, 2018 in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

568 views 6 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you