JIRA - JAVASCRIPT - hide customfield doesn't work

In JIRA 5.1.6,

I'm trying to hide a customfield by a JAVASCRIPT (in description field)

this is my code :

<script language="JavaScript">
jQuery('#customfield_10056').parent().hide(); 
</script>

but no success ...

Regards,

Sven.

2 answers

1 accepted

Did you make sure this code will be executed after the content has been loaded in the page ?I recommend running this witing

It should be within "$(document).ready", so should be like this:

AJS.$(document).ready(function() {
  AJS.$('#customfield_10056').parent().hide();
});


Cheers,

Omar

1 vote
Timothy Chin Community Champion Jan 16, 2013

Try it with:

AJS.$('#customfield_10056').parent().hide();

This is maybe related to the nature of this field ? It is a free Text Field.

Hi Tim,

Thanks for your help.

I'm still having the issue.

I don't if it's coming from my version.

Thanks,

Sven.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Marketplace Apps

Tips on how to choose the best estimation method for your planning

Planning and grooming sessions all come with their own sets of rules. Team members meet to estimate stories or other work items, all according to an agreed-upon process. And with every session comes ...

78 views 0 11
Read article

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