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

Simple Script Condition JIRA Script Runner

Simple question I hope. I have a custom field (titled - "issueClone") single line text field that I am trying to check on creation via Script Runner-->Script Validator-->Simple scripted validator . I have set the following combinations in the condition:

cfValues['issueClone']?.value != null

cfValues['issueClone']?.value == 'invalidclone'

cfValues['issueClone']*.value == 'invalidclone'

cfValues['issueClone'].value == 'invalidclone'

cfValues['issueClone'] == 'invalidclone'

cfValues['customfield_12345'].value == 'invalidclone'


No matter what I try whenever the user tries to create the issue the validator script throws the error. By default the field is blank. No matter what is in "issueClone", empty or not, the validator throws the error.

The end game here is that we are trying to prevent users from cloning clones. I have a post function that runs on "Creand adds "invalidclone" to the "issueClone" field once a clone is created. I was hoping that I could then use a simple script validator to throw the error if "issueClone" contained "invalidclone".

2 answers

1 accepted

1 vote
Answer accepted

If you want to check that it's not null, and assuming it's a text field, and really called issueClone (correct case and spacing?) then:


is what you need. If it's actually called "Issue Clone", then use:

cfValues['Issue Clone']

If you want to block it unless the value is "invalidclone" then use:

cfValues['issueClone'] == 'invalidclone'

but I suspect you have the name wrong.

Hi Jamie,

This worked for me.

cfValues['issueClone'] != 'invalidclone'

The field is named "issueClone" so that it displays at the bottom of the "Custom Fields" list and also it is not mistaken to other administrators as a general field due to the name format. The above works, so thanks for the suggestions.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

We want to hear from you! How do you use Slack and Atlassian together?

Hi Everyone! My name is Mina and I am on Atlassian’s Ecosystems Marketing team. Our team is focused on our technology partnerships and marketplace apps. One of Atlassian’s partners is Slack, who ...

85 views 1 5
Join discussion

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