Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Javascript code is unable to load when issue summary is open first time

Prashant Mali September 21, 2016

I have use javascript code in issue tab panel vm file.

It works only when page reload.

 

 

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Volodymyr Krupach
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.
September 21, 2016

You will need to listen on JIRA JavaScript event: JIRA.Events.ISSUE_REFRESHED. You can search through sources for some samples but the entry point will look like:

JIRA.bind(JIRA.Events.ISSUE_REFRESHED, function() {
              // your code
            });

My practical advise is to avoid relying on JavaScript. It's very unreliable and I encourage you to think if you can redesign your addon.

Prashant Mali September 21, 2016

Hey dear,

 Thanks

then tell me one query Is it possible to show other vm after select change event is fired on Issue tab panel.

Actually i have different multiple fields to show on select change event. so how to do that?

 

 

Prashant Mali September 21, 2016

Hey I tried this code but still it is not working for me

Volodymyr Krupach
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.
September 21, 2016

> I have different multiple fields to show on select change event
Not sure what kind of fields do you mean but if you mean your own custom fields then they should have a vm view and should be re-loaded by JIRA JS framework.
> Is it possible to show other vm after select change event is fired on Issue tab panel.
Again not clear what do you want to achieve but you can listen on JIRA.Events.ISSUE_REFRESHED and do AJAX call to the server and there render vm to reposnse (see here).
Anyway do NOT do any hacks! Hacks is a kamikaze way and even if you make it work in your JIRA, it will not work in other installations or/and other versions.

Prashant Mali September 21, 2016

Question 1:

I will tell you step by step what I did

1) I created one issue tab panel (VM file):

             there is one select box and other related custom fields

2) then I called servlet action from that page(redirecting to same page)

             here is my business logic

3) I wanted to hide some custom fields on select change event.

the code which u have given is not working for me.I don't know why.

Can you please send me example code

JIRA.bind(JIRA.Events.ISSUE_REFRESHED, function() {
  // your code
});

for this function

 

Question 2:

How to separate javascript code from vm file.

 

 

 

Prashant Mali October 6, 2016

Hey 

0 votes
Prashant Mali September 21, 2016

please suggest me any idea that how can load it at first time

 

TAGS
AUG Leaders

Atlassian Community Events