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

IshanL
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 4, 2013

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

1 vote
Answer accepted
jayasingh July 7, 2013

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

IshanL
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 7, 2013

Hi Jaysingh,

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

1 vote
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 6, 2013

Does this work?

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

alert('me');

});

0 votes
IshanL
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 7, 2013

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');

});

0 votes
IshanL
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 4, 2013

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.

0 votes
Dipti Ranjan Behera
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 4, 2013
Dipti Ranjan Behera
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 4, 2013

@ishan : i updated my answer , please check again

IshanL
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 4, 2013

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.

0 votes
Dipti Ranjan Behera
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 4, 2013

Hi Ishan,

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

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

IshanL
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 4, 2013

Futhermore, this happens only on dashboard.

IshanL
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 4, 2013

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

Suggest an answer

Log in or Sign up to answer