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

Creating custom field with custom logic


All custom fields that come out of the box with JIRA have predefined purposes, such as text field, which allows users to type in some simple text. It will often be useful to have a specialized custom field that does exactly what you need. Unfortunately, this often requires custom development efforts.

However, there is an add-on that provides a custom field type that lets you use Groovy scripts to power its logic.

In this recipe, we will look at how to create a custom field that uses a Groovy script to display the total number of comments on any given issue.

Getting ready

For this recipe, we need to have the Script Runner add-on installed. You can download it from the following link or install it directly from the Universal Plugin Manager at https://marketplace.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner.

You may also want to get familiar with Groovy scripting at http://groovy.codehaus.org.

How to do it…

Creating a scripted field is a two...