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

This widget could not be displayed.

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.

This widget could not be displayed.

Does this work?

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

alert('me');

});

This widget could not be displayed.

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.

This widget could not be displayed.

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.

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

276 views 5 0
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