JIRA comes with tons of functionalities and customizations; however, there are times when you want more control over the behavior of HTML fields. For instance, if you want to show or hide a particular custom field on the basis of a value of another custom field, then you can use custom JavaScript to do this.
Let's take a scenario where users who create the ticket in JIRA need to enter their analysis in one of the text areas based on the custom field, but they only need to fill it when the priority of the issue is critical. Now, in order to achieve this, we want to completely hide the Analysis field first and display it only when users select Priority as Critical.
Unlike the preceding example to insert custom CSS, the custom JavaScript can be added directly from the JIRA interface. Perform these steps:
Go to JIRA Administration | Issues | Custom Fields (under FIELDS).
Click on the Add Custom Field button at the top-right corner and select Field Type as Text...