Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Groovy_issue_VALUE_field validation

Mateusz Janus
January 5, 2026

Brothers, Sisters

simple question. I am building transition Validator.

I need to write simple Groovy condtion. I have a customfield_11111 with possible values, "Yes" and "No".

My validator must check if customfield_11111 = Yes.

Thats it.... please, I know its dump question but I dive too deep probably instead of quick win,

 

This is what i achieved so far but with no results :(

 

import com.atlassian.jira.component.ComponentAccessor


def issue = issue // Bieżący problem w kontekście
def customFieldManager = ComponentAccessor.getCustomFieldManager()

def field1 = customFieldManager.getCustomFieldObject("customfield_11111")


def value1 = issue.getCustomFieldValue(field1)


if (value1 = "Yes") {
return true // Walidacja przekracza
} else {
return false // Walidacja nie powiodła się
}


1 answer

1 accepted

4 votes
Answer accepted
Marc -Devoteam-
Community Champion
January 5, 2026

Hi @Mateusz Janus 

What app do you use for groovy scriptrunner or another workflow extension app.

For scriptrunner:

def customfield_11111 = issue.getCustomFieldValue('customfield_11111').toString()

customfield_11111 = 'Yes'
replace customfield_11111 with the name of the field.
Mateusz Janus
January 5, 2026

hey,

thanks for quick reply. YES i am using ScriptRunner.

I update Transition and click "Validators-> Add Validator -> Fields Required Validator (JSWE app), 

 

This is list of my AVAILABLE options:

Build-your-own Validator (JMWE app)
Comment Required Validator (JMWE app)
Field has been modified Validator (JMWE app)
Field has single value Validator (JMWE app)
Fields Required Validator (JMWE app)
Parent Status Validator (JMWE app)
Previous Status Validator (JMWE app)
Related Issues Status Validator (JMWE app)
Related Issues Validator (JMWE app)
Shared Validator (JMWE app)
User Validator (JMWE app)
Custom script validator
Date Compare (JSU)
Date Expression Compare (JSU)
Date Window (JSU)
Field(s) changed validator
Field(s) required validator
Fields Required (JSU)
Linked Status (JSU)
Permission Validator
Regular Expression Check (JSU)
Regular expression validator
Require a comment on transition
Simple scripted validator
User Permission Validator
User in field(s) validator 
Marc -Devoteam-
Community Champion
January 5, 2026

Hi @Mateusz Janus 

So you are using the JMWE app?

In JMWE, you use the build your own validator option.

Then use groovy:

issue.get("customfield_11111") = "Yes"

Mateusz Janus
January 5, 2026

ok so i did as u said
Descritpion: test
Error message: Field not "YES"

Choose type: Groovy script

Groovy script: issue.get("customfield_11776") = "Yes"

For Field: customfield_11776

And i get this error....

An error occurred while executing a Build-your-own Validator validator: startup failed: script_8a8649c80aab45e06411d1416129925c.groovy: 1: The LHS of an assignment should be a variable or a field accessing expression @ line 1, column 1. issue.get("customfield_11776") = "Yes" ^ 1 error Build-your-own Validator: root cause: startup failed: script_8a8649c80aab45e06411d1416129925c.groovy: 1: The LHS of an assignment should be a variable or a field accessing expression @ line 1, column 1. issue.get("customfield_11776") = "Yes" ^ 1 error

It seems that you have tried to perform an illegal workflow operation.

If you think you shouldn't get this message, please contact your Jira administrators.

 

Mateusz Janus
January 5, 2026

@Marc -Devoteam- is it relevant that my custom field is Radio Button type?

Marc -Devoteam-
Community Champion
January 5, 2026

Hi @Mateusz Janus 

No this doesn't matter.

If custom field with id 11776 is a radio button field, the groovy on the validator should work with:

issue.get("customfield_11776") == "Yes"

Mateusz Janus
January 5, 2026

@mar AMAZING. It works now

Suggest an answer

Log in or Sign up to answer