Strange JavaScript problem in create screen

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

5 votes
Accepted answer

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!!!");
});

Hi Prasad,

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

 

 

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.

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

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

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

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

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

How would you do this ondemand?

Hello Matthias,

are you german?

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

Best regards

Toni

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. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published yesterday in Agile

Are you a Jira Service Desk agent? We want to talk to you!

Are you a whiz at handling tickets and looking at how you can further optimize your workflow with automation? Do you tackle detailed customer support questions while simultaneously getting flooded wi...

26 views 0 2
Read article

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