It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Making a custom field mandatory based on the value of a fix version

My fix version values are 2019-ABC, 2019-DEF and 2019-XYZ.

I want a custom field called "Release Date" to be mandatory when some selects fix verson as "2019-XYZ". 

Can someone help me with this using Script Runner?

2 answers

1 accepted

1 vote
Answer accepted

Hi @Sunil Mandalika 

Here is the code for you.

def fixVersion = getFieldById(getFieldChanged()).getValue()
def releaseDate = getFieldByName("Release Date")
log.debug("Fix Version: " + fixVersion)

if (fixVersion.toString().contains("2019-XYZ") ) {


} else {


Use this code in the behaviour. Create a behaviour, define mapping to a project, add the Fix Version/s field and use the above code in the server-side script.

I hope it helps.


Thanks, this worked for me.

Like Ravi_Sagar__Adaptavist_ likes this

That's great. Thanks for letting me know.

@Ravi_Sagar__Adaptavist_ Sorry for the delay in responding to your answer. The script worked for us. Thank you for that. To take this a step further, can we write a regular expression in stead of checking for a constant called "2019-XYZ".

My fix version are named as "YEAR-MMM-OFFSCHEDULE", the year and month change for every month, but the last phrase does not change and it always alphabets. 

I would like to change "

if (fixVersion.toString().contains
("this to be a regular expression which validates XXXX-XXX-OFFSCHEDULE"")

the first 4 XXXX are numbers

the second 3 XXX are alphabets

Hi @Sunil Mandalika ,

With the help of Behaviours From ScriptRunner for Jira you will be able to configure this.



Suggest an answer

Log in or Sign up to answer

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you