Forums

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

compare custom field value to a string in jython validator

Olivera Tancheva January 11, 2019

Hello I am trying to write a Jython validator which compares a custom field value to a string. I have the following code:

from com.atlassian.jira.component import ComponentAccessor
cfm = ComponentAccessor.getCustomFieldManager()

location = issue.getCustomFieldValue(cfm.getCustomFieldObject("customfield_12032"))

if str(location).lower() == 'Business Trips'.lower():
result = False
description = "Please select whether this will be compensated by the customer"
invalid_fields['customfield_12032'] = "You need to select an option"

But it does not work.

 

Any ideas?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events