Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,557,125
Community Members
 
Community Events
184
Community Groups

Remove "None" from cascading select list

Hi,

I’d like the “none” option removed from the second dropdown(child list) in the cascading field.

Also, I’d like to set a default value for the child list.

Like, if i choose option A in parent list, by default option B should be set in the create form and also user should be able to change the child option as well as parent option.

I am using below behaviour script which sets the field value in the create issue form. But when i am trying to change the value it is again setting the value from script and does not accepts the one i choose. 

"

import com.atlassian.jira.component.ComponentAccessor


def optionsManager = ComponentAccessor.getOptionsManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()

def emailtype = "Email Types"
def email = getFieldByName(emailtype)
def customField = customFieldManager.getCustomFieldObjectByName(emailtype)
def fieldConfig = customField.getRelevantConfig(getIssueContext())

log.debug("email" + email.getValue())

def options = optionsManager.getOptions(fieldConfig)
def parentOption = options.find {it.value == "Test Store"}
def childOption = parentOption?.childOptions?.find {it.value == "Promotional"}

if (email.getValue() =~ parentOption)
{
email.setFormValue([parentOption.optionId, childOption.optionId])
}"

If i choose "Test Store" in parent list it automatically sets the child to "Promotional". But i have other options in child and when i choose the other options, it is again setting to "Promotional". The same is happening for parent list.

I need Promotional to be default if i select Test store in the parent list initially and if i change the options it should change and not default to the one in the script.

Kindly let me know how to solve this. Also let me know how to remove none from the child list.

Thank You,

Krithica

 

1 answer

0 votes
Nadir MEZIANI
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Dec 19, 2017

Hi ,

for none option , try to customize by deleting the common.words.none in this file template

JIRA_HOME\atlassian-jira\WEB-INF\classes\templates\plugins\fields\edit\edit-cascadingselect.vm

For the default value ,i think  you could just order the options and put the default value in the first.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events