It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to set "none" cascade select list to child

Hello,

 

when I use the following code to reset child option in cascade select list is not working.

Could you help me?

Best regards.

 

_________________________

I checked with:

def fieldConfig = customField.getRelevantConfig(issue)

def options = optionsManager.getOptions(fieldConfig)
def parentOption = options.find {it.value == parentValue}
def childOption = "none"

cfModule.setFormValue(parentOption.optionId, childOption )

 

And

def fieldConfig = customField.getRelevantConfig(issue)

def options = optionsManager.getOptions(fieldConfig)
def parentOption = options.find {it.value == parentValue}
def childOption = null

cfModule.setFormValue(parentOption.optionId,childOption )

 

 

1 answer

1 vote

"none" is what Jira displays when a select-type field is empty.  It's not actually "none", it's <nothing here>

I have not tried it for myself (as I'm not sure where you might be coding), but try

def childOption = ""

or

def childOption = null

Hello @Nic Brough {Adaptavist} ,

in your documentation there are examples "how to set" but I think any about "how to release" :)

I checked also def childOption = "" with no success.

Always appears the same error:

 

IF ""

No signature of method: com.atlassian.jira.issue.fields.ImmutableCustomField.setFormValue() is applicable for argument types: (java.lang.Long, java.lang.String) values: [10233, ] at Script1947.run(Script1947.groovy:48)

 

IF null

No signature of method: com.atlassian.jira.issue.fields.ImmutableCustomField.setFormValue() is applicable for argument types: (java.lang.Long, null) values: [10233, null] at Script1950.run(Script1950.groovy:48)

 

Actually, If I do 

log.warn(parentOption?.childOptions?.toString())

 

the information is:

[20191201, 20191101, 20191001, 20190801, 20190701, 20190601, 20190501 , 20190401, 20190301, 20190101, 20181201, 20181101]

so in my opinion is dificult "to set null or empty because in the map of child there is no this option.

 

Thanks for you quick first answer.

 

Best regards.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Align

Announcing the Jira Align Early Advocate limited edition badge!

Hello and Happy New Year to our Jira Align Community Collection visitors! The Jira Align community is growing quickly, and we’re excited about all the great content that has been posted so far. To ...

1,355 views 41 27
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you