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

Accepted Answer
1 vote

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
Community showcase
Posted Tuesday in Jira

Looking for anyone who made the switch to Data Center

The Jira Marketing team is putting together an ebook on migrating to Data Center. We're looking for pro tips on how you staffed your project team and organized your Proof of Concept. Share yo...

29 views 0 2
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