Hiding the wiki rendered customfield using javascript in JIRA 4.3.+

Hello Friends,

This is one of the tutorials under jira development. There may be requirement when you need to use the wiki rendered custom field instead of Free Text rendered field. Also, sometimes you may need such fields to be shown only when certail criteria are matched. So in this case you need to hide those fields by default so that the normal user cannot view or edit the field. This tutorial demonstrates how the field can be hidden from the screen.

Let us consider an example where we have one select list type field, say SelectType with 4 options A, B, C, D. Now we want that whenever the option C is selected we need to display the wiki rendered custom field W , and for remaining options W will be hidden.

So, we need to write the javascript in the description area of customfield W. Following is the code for that.

Now, as you can see in lines 20 and 24 we have to get the third parent node and element. If you use only one parentNode and one parentElement then it will only hide the text area and not the labels, so to hide the labels you need to get the parent at the top third level.

Hope this will help you 🙂

Regards,

Nikhil Naoghare.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.