How to user a radio button in order to trigger a multiline field in jira service desk

Thomas Gschwendner January 22, 2020


i am wrapping my head around how to set up a behaviour, that does the following:

I have a radio buttons field with the options (1) Analysis and (2) Tracking.

In a field "purpose" i want to have a certain text if Analysis is selected and no text at all if Tracking is selected.

Anybody knows how to do this and can show me directions for? Thank you!

1 answer

1 accepted

0 votes
Answer accepted
Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 27, 2020

Hi @Thomas Gschwendner ,

I would advise to create a behaviour and link it to the radio buttons field, and use this code snippet : 

import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript

@BaseScript FieldBehaviours fieldBehaviours

def purposeId = 12900
def purpose = getFieldById("customfield_" + purposeId)

def checkBoxFieldId = 12800
def checkBoxField = getFieldById("customfield_" + checkBoxFieldId)
def checkBoxValue = checkBoxField.getValue()

if (checkBoxValue?.contains("Analysis")){
purpose.setFormValue("Analysis is selected")
if (checkBoxValue?.contains("Tracking")){

Update it with your custom fields ids.


Will Attwood
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 4, 2024

When I attempt this, I get the following error:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script1.groovy: 1: unable to resolve class com.onresolve.jira.groovy.user.FieldBehaviours @ line 1, column 1. import com.onresolve.jira.groovy.user.FieldBehaviours ^ 1 error at at at at Source)


Like Antoine Berry likes this

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events