Making a field non-mandatory using ScriptRunner scripts


I have a field mandatory in couple of projects sharing a single workflow. 
I am making this field mandatory using workflow validators on create issue screen for all these projects.

Now there is a project (ABC), and I don't want the field to be mandatory in it. 
Could someone tell me how to do that? 
How can I make an exception for that project without disturbing all the other projects?

P.S. Creating a new field configuration is not ideal for me. And would be the last approach.

Many thanks,

3 answers

1 accepted

1 vote
Accepted answer

Field configurations make  field mandatory from creation time, so I assume you're using validators because you need them optional for part of the lifecycle.  (If you need them mandatory throughout, then you absolutely should be using field configurations)

So, the simple approach - copy the workflow in use, put it in a new workflow scheme for the new project, and strip the validators out of it.

I would need to create both a new workflow and a new workflow scheme for it?

Yes, that's one of the things workflow schemes are for - to allow issues to follow different processes.

I would reccomend to use field configuration scheme beacause it garantee that after creation value for these fields will not be set to null. And these make it simpler to use the same workflow into different projects.

I created a new field configuration, but since the fields are being made mandatory using a workflow validator, I can't make them optional with the new field config, right? 

You are rigth. That is field configuration for. You have the same workflow, but different mandatory fields into different projects. 

In your case I would reccomend you to define where to reasilse logic for mandatory fields: into field config or into workflow validator.

Benefits for field config:

  • mandatory fields will not be made empty 
  • will be marked with red star on create screen
  • more flexible to use into different projects


Plus, with field configs, you can carry on using the same workflows.


If you want to use script runner plugin then You can use a behaviour section to make a field mandatory for a specific project and issue type

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,164 views 5 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you