Javascript hidden field does not hide on JIRA 5.1, but is hidden on JIRA 4.0

Javascript hidden field does not hide on JIRA 5.1, but is hidden on JIRA 4.0

Just wondering if it still should work in v5.1 i.e. I have javascript on a custom field (my javascript is in the description of the custom field), when I check the custom fields checkbox another field is displayed giving the user more options.

This works as expected in JIRA 4.0, but on my test install of 5.1.1 I see all options displayed on form load.

Maybe you can point me in the right direction, is it a config option on the new form? Any ideas why this is/would happening?

Background: I've just upgraded to v5.1.1 and migrated my v 4.0 database via an xml export/import.

Ta,

1 answer

1 accepted

Hi, the way events and Javascript is handled has changed since JIRA 5.x. Please refer to https://developer.atlassian.com/display/JIRADEV/Custom+Fields+that+use+CSS+or+JavaScript+Web+Resources+in+JIRA+5.0 for more information.

Hi, the same applies. I gave a similiar example here for what it now should be - https://answers.atlassian.com/questions/79201/jira-5-1-2-questions-re-pop-up-issue-edit-window

Hi Harry,

Thanks for the link, it refers to updating plugins that use customfields/JavaScript. My query was in relation to JavaScript placed in the description of a stock custom field.

The penny drops... I see the reference to JIRA.Events.NEW_CONTENT_ADDED

JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
AJS.$(".myspecialfield", context).css("background-color", "#8f8");
});
I'll give that a go and let you know how I get on , thanks Harry.

It seems to work on issue creation, but only after the page has fully loaded, and it does not work on edit screen. It's a step in the right direction I suppose, thanks Harry.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,754 views 11 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot