Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

My Plugin Web Ressources doesn't work

Deleted user August 24, 2018

Hello,

I make a plugin to execute some Javascript in all the pages of my JIRA Application.

The web-ressource in my file atlassian-plugin.xml :

 <web-resource key="test">
<ressource type="download" location="js/test.js" />
<context>alt.general</context>
</web-resource>

To test the plugin, I put only a console.log("OK") in the file test.js.

I load the plugin in JIRA, but the Javascript code doesn't work...

 

Note : the plugin work correctly because I have a web-item who work fine.

3 answers

1 accepted

0 votes
Answer accepted
Deleted user September 19, 2018

Well...

I find the error...

It's just... ONE Character !!!

 

I write "ressource" with 2 "s"...

miikhy
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.
September 19, 2018

Oh gosh...

Glad you've found it out! Could have taken more time!

Enjoyr the rest of your dev steps :)

Deleted user September 19, 2018

Thank's Micky ^^ !

0 votes
Deleted user September 3, 2018

Up

miikhy
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.
September 3, 2018

Hey!

Still me, live from Summit! Have you tried using your own context instead of atl.* and include them in your Velocity templates with the resource manager? Never had issues with that!

Let me know :)

Cheers

Deleted user September 4, 2018

I see some topics related to Velocity, but I don't understand exactly what it that...

I don't try this so.

You can give me a basic example :) ?

 

Basically, i want to put a Javascript librarie on each page of my JIRA application, to use it with the plugin JSIncluder.

Deleted user September 11, 2018

Up

0 votes
miikhy
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.
August 27, 2018

Hi Raphaël,

Have you tried using atl.general? :) (mispelled in your example).

Cheers

Deleted user August 28, 2018

Oops thanks.

But it still doesn't work :( ...

Like 김진식 likes this
miikhy
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.
August 28, 2018

In my plugins I have the following:

<resource type="download" name="filename.js" location="/js/filename.js"/>
<context>myContext</context>

And the path is src/main/resources/js/filename.js

Could you try with the leading "/" ?

Also, inputing an alert is not a good idea to test as the resource can be loaded before page render, what I've done in the past is more defining vars and checking them in console or:

AJS.$(document).ready(function() {
    alert('test');
});

which ensures the body is ready before popping the alert.

Let us know if it worked!

Cheers

Deleted user August 28, 2018

I also try with the "/", but nothing change...

I prefer put a console.log because its non-blocking, so I try like this :

AJS.$(document).ready(function() {
console.log("OK");
});

But same result : nothing in my console...

miikhy
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.
August 29, 2018

Have you tried using context, not global context? I can't use the SDK now to check atl.general but never had problems with specific ones!

Have you also made sure to refresh your localhost:2990/jira page with no cache (shift + refresh)? New javascript resources are always lagging on my laptop for instance and I've been very frustrated before discovering a simple cache refresh made it work sometimes!

Hope this helps!

Cheers

Deleted user August 29, 2018

I also try atl.admin but nothing.

I test my plugin on a different instance (because my localhost:2990/jira doesn't work fine...), I try to refresh cache (ctrl + f5, and shift + f5) but... nothing.....

I don't understand why.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events