JIRA - JAVASCRIPT - hide customfield doesn't work

Sven Lecherbonnier January 16, 2013

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

3 votes
Answer accepted
OmarA
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.
January 17, 2013

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
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.
January 16, 2013

Try it with:

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

Sven Lecherbonnier January 17, 2013

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

Sven Lecherbonnier January 17, 2013

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