Strange JavaScript problem in create screen

RambanamP
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 12, 2012

Hi,

on create issue screen JavaScript not loading on project or Issue type change(in jira 5.0).

it is loading the script which will be in the field configuration which is selected before loading the popup(already selected issuetype or project).

any one have experince the same problem?

Thanks

6 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

8 votes
Answer accepted
RambanamP
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 25, 2012

finally it worked by using webresource as

<web-resource key="test-js" name="javascript">
		<dependency>jira.webresources:global-static</dependency>
		<description>JavaScript</description>
		<resource name="test.js" type="download" location="templates/js/test.js" />
		<context>atl.general</context>
		 <context>atl.admin</context>
	</web-resource>

test.js looks like

JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) {
alert("Hello!!!");
});

Manikanta July 21, 2017

Hi Prasad,

Could you please let us know where to put this script ?

 

 

1 vote
JamieA
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 12, 2012
JamieA
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 12, 2012

But you seem to know this already judging by your answer here: https://answers.atlassian.com/questions/45825/how-to-remove-options-from-a-multi-version-picker-field - so maybe I misunderstood.

RambanamP
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 13, 2012

Yes , but i stuck in how to make it work :(

0 votes
Scott McCormick October 20, 2014

Instead of creating a custom plugin for this, I just added the javascript to the Announcement Banner.  That worked for me in version 5.2.11. 

0 votes
Matthias Erl June 5, 2012

Thank you for your answer.

I haven t developed any plugin. I have written some javascript code in the description field in the fieldconfiguration (so I can t find the atlassian-plugin.xml?!).

Now when I change the issuetype (so I change the fieldconfiguration because the other issuetype has another configuration) the javascript doesn t work.

Is it possible to handle this??

Thank you very much!

Greets,

Matthias

RambanamP
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.
June 5, 2012

Yes, you can handle but the problem is you have to add the javascript in all field configuration but is not suggestible so the best way is using plugin.

It is easy to develop plugin and you can add it in any one of your own plugins

Stephen Kervin November 25, 2012

How would you do this ondemand?

TechnicalS February 9, 2014

Hello Matthias,

are you german?

We have the same problem. Did you fix it? And how?

Best regards

Toni

0 votes
Matthias Erl June 4, 2012

0 votes
Matthias Erl June 4, 2012

Hey everybody,

I got the same problem as rambanam prasad

Where should I put the web-resource?

And where should be the test.js? Is the js-file in the Atlassian Directory?

Can anybody give me a detailed instruction please.

Thank you very very much!

Greets,

Matthias_Erl

RambanamP
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.
June 5, 2012

web resource module can be add to any existing custom plugin or you can develop new one

you have to add the web resource module in atlassian-pluginn.xml and test.js should be in resorces/templetes/js

*js is a folder and it is optional

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events