Javascript code only triggered in second time in create Issue pop up

Hi All,

I found that Javascript code only triggered in second time in create Issue pop up. I mean javascripts that embedded in custom fields.

e.g

JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {

alert("Hello People");

});

Alert comes only in the second time onwards, when we click on create issue. Any feedback on this?

6 answers

1 accepted

Hi Ishan,

you can try this link
https://answers.atlassian.com/questions/107997/facing-javascript-problem-while-migrating-from-jira4-4-to-jira5-x

I faced the same javascript issue and it got resolved.

Cheers,

Jayasingh

Hi Jaysingh,

That what I have done. Anyway thanks for the answer.

1 vote
Renjith Pillai Community Champion Jul 06, 2013

Does this work?

AJS.$(document).bind('dialogContentReady', function(event, dialog){

alert('me');

});

Hi Ishan,

You need to hook into the show dialog event... so you put your code in:

AJS.$(document).bind('dialogContentReady', function(event, dialog) {
...
});

Futhermore, this happens only on dashboard.

Hi Dipti,

nope, it did not work. I tried it already. my problem is my javascript code works in second time onwards. When I click on create issue in first time, it will not work and cancel the pop up and click on second time it will work

@ishan : i updated my answer , please check again

Thanks for the answer, I have done all those things already. but not worked. my problem happens only the first time when I click create issue. secong time onwards it works.

Thanks for the answer, I have done all those things already. but not worked. my problem happens only the first time when I click create issue. secong time onwards it works.

Hi Renjith,

I tried this already, unfortunately not worked. at the end of the day I used like this,

JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context, reason) {

$(document).ready(function(){

alert('me');

});

});

//Following line needed when first time create issue pop up loading on dashboard

$(document).ready(function(){

alert('me');

});

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,269 views 14 20
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot