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.

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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

696 views 6 13
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