Forums

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

[scriptrunner] get select list value and set text field value

arno
Contributor
July 29, 2024

Hi all

   I tried to write my code in initialiser and found that I couldn't get the value of the single field. If I used the "getFieldchanged ()" method in fileds, this would be fine. I can get the radio field value normally.

  But I need to determine the value of the two radio fields, so I can't reference another field in fileds and get the corresponding value.

  Here's my code

 


 

def filed = getFieldById('customfield_14801')
def filed1 = getFieldById('customfield_14802')
def filed2 = getFieldById('customfield_14803')   // this is a text filed
def value = filed.getValue()
def value1 = filed1.getValue()
if (value == 'other' && value1 == 'other' ){
   filed2.setRequired(true)
}

I try to determine if the field has a value, and whatever option my radio field selects returns null

def text = """  $value """

filed2.setHelpText(text)

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events