Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JIRA 5.1 - 2 questions re: pop-up issue edit window

Just upgraded to JIRA 5.1 - love it.

We had set up some javascript in field descriptions - simple stuff to help us populate description fields, and comments - that worked great in JIRA 4.x However, when I upgraded, it stopped working. Whenever I click on the issue Edit button, a popup window appears and the javascript stops working. If I right click on the Edit button, and open the edit window in a new tab, the javascript works.

So, I have two questions...

a) can I turn off the pop-up issue edit window that appears?

b) is there some way to get the javascript working for issue fields?

Thanks

Chris Gray

3 answers

1 accepted

5 votes
Answer accepted
In JIRA 5 onwards, you need to do something like:

(function($) {
    }
  
    AJS.toInit(function(){
        // old function
    });
  
    JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
        // old function
    });
})(AJS.$);


I'm not sure if it helps, but we had some similar troubles with issue-edit-popup. We had javascript which made two tips arising near customfields, and after upgrading to the 5.1 they disappeared, but in a new tab all worked fine. So after searching we realized that our were simply under issue-edit-popup - we styled them like this a.style.position='absolute';a.style.zIndex="4100"; and they began to work normally.

Nope - that doesn't do it. The javascript in the description of the field is set up as per https://confluence.atlassian.com/plugins/viewsource/viewpagesrc.action?pageId=121127, and it worked up to the point that we upgraded to JIRA 5.1. It still works, but only if the edit page is not a popup.

You can disable the edit issue popup by disabling the "Quick Edit Plugin" via the Plugins admin page, but it really is throwing the baby out with the bathwater. The custom JavaScript would also not work with inline edit and any other UI improvements we add in the future.

As Harry mentioned, the JavaScript just needs to bind to the JIRA.Events.NEW_CONTENT_ADDED event instead of executing on page load.

The relevant documentation page is here - https://developer.atlassian.com/display/JIRADEV/Custom+Fields+that+use+CSS+or+JavaScript+Web+Resources+in+JIRA+5.0

Quick edit plugin cannot be disabled from plugins admin page. Tried with versions 5.0 - 5.1.3 . Has this changed in newer versions?

https://answers.atlassian.com/questions/45607/non-ajax-edit-view-on-jira-5

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you