Book Image

JIRA 6.x Administration Cookbook

By : Patrick Li
Book Image

JIRA 6.x Administration Cookbook

By: Patrick Li

Overview of this book

Table of Contents (16 chapters)
JIRA 6.x Administration Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using JavaScript with custom fields


Just as in the Adding help tips to custom fields recipe, we can also add JavaScript code in the custom field description as long as we wrap the code in the <script> tags.

In this recipe, we will look at another way to remove the None option from select list custom fields.

Getting ready

This recipe uses the jQuery JavaScript library, which is bundled with JIRA. If you are not familiar with jQuery, you can find the documentation at http://jquery.com.

We will also need to use the custom field's ID in our script, so you will need to have that handy. You can find the ID by going to the custom fields page, clicking on the Edit link of the target field, and clicking the number at the end of the URL is the field's ID. For example, the following URL shows a custom field with the ID 10103:

http://jira.localhost.com:8080/secure/admin/EditCustomField!default.jspa?id=10103

How to do it…

Proceed with the following steps to add JavaScript to custom field description...