JIRA: Adding validators to issue transitions

JIRA is quiet complex but it’s an amazing tool.

Recently, a requirement come up at my company. This requirements consists of making two custom fields that are visible only for issues of type bug to be filled in order to transition the issue from any existing state to done.

Here’s how I accomplished it.

1) “Bugs should display two custom fields”: Let’s create our custom fields:

Step 1:

Step 2:

From the list below chose text field multi line

Name the field as you wish and for now we are all set!

 

Just to let you know, there are some additional settings for fields, for example, translations if you click the “cog” icon.

 

2) Bugs should be displayed differently from other issue types:

Step 1:

Step 2:

Step 3:

Step 4:

Step 5: 

Add your custom fields to your screen.

If you would like, you can also organize your fields into tabs (a) or add additional fields (b)

 

3) Bugs cannot transition to “done” if our two custom fields are empty

Since validators is not a native feature of JIRA, we have to install a plugin to assist us here.

Let’s download JMWE for JIRA server (you might want JIRA Cloud if you are not hosting jira yourself)

Then get the trial license (you will need it later).

From Jira, go to settings > add-ons.

Upload the .jar file that you downloaded previously and make sure to setup the plugin by adding your trial license there.

Now let’s configure our workflows.

Click the “issues” tab

 

And now all you have to do is find your projects schema.

Among the trasitions (id) column , you must click Done (X) where X in my case is 41.

(In the above image my validator is already created)

Here’s how my validator looks like:

You can edit or remove validators by mouse hovering the validator

Now, whenever I wan’t to resolve a bug issue, those two fields must be filled up. If you check my Groovy Script, you will see that I only require this two fields to be filled if the Issue Type is a bug.

 

Hope you liked it.

Cheers

 

 

 

 

Leave a Reply

Close Menu