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 workflow transition logic


In previous recipes, we have looked at using workflow conditions, validators, and post functions that come out of the box with JIRA and from other third-party add-ons.

In this recipe, we will take a look at how to use scripts to define our own validation rules for a workflow validator. We will address a common use case, which is to make a field required during a workflow transition only when another field is set to a certain value.

So, our validation logic will be as follows:

  • If the Resolution field is set to Fixed, the Solution Details field will be required

  • If the Resolution field is set to a value other than Fixed, the Solution Details field will not be required

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 using the Universal Plugin Manager:

https://marketplace.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner

You might also want to get...