Forums

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

How to remove all the options of a select list custom field using behaviours (Script Runner)

SWAPNIL SRIVASTAV
Contributor
November 8, 2019

How to remove all the options of a select list custom field using behaviours (Script Runner).

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Alejandro Suárez García
Atlassian Partner
November 9, 2019

Hi @SWAPNIL SRIVASTAV 

You could simply do this (you can put this in the initializer script):

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

@BaseScript FieldBehaviours fieldBehaviours

FormField ffPruebaSL = getFieldById("customfield_10201") // Change with your field ID

ffPruebaSL.setFieldOptions([:])
// If you want the "None" Option to be available uncomment the following line and comment the previous one
//ffPruebaSL.setFieldOptions(["0":"None"])
TAGS
AUG Leaders

Atlassian Community Events