Need to create a custom field with single choice and based on the selection other preferred custom fields should pop up in create screen. im using script runner plugin and im new to jira . please guide me .
EX: A= B and C . If i select B some different option should pop up and if i select C another set of options should be poping up .
Hi @Naveen kumar You can easily do this with the help of Behaviour of Script Runner :-
def selectlist1 = getFieldById("customfield_35743")
def Testfield1 = getFieldById("customfield_36079")
def Testfield2 = getFieldById("customfield_36080")
log.debug("dropdown value" + selectlist1.getValue())
if (selectlist1.getValue() == "B") {
Testfield1.setHidden(false);
Testfield1.setRequired(true);
Testfield2.setHidden(true);
} else if (selectlist1.getValue() == "C") {
Testfield1.setHidden(true);
Testfield1.setRequired(false);
Testfield2.setHidden(false);
}
Add Server side script on Select List field beacuse other fields are hidding based on Select list.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
also i didn`t catch the meaning of "pop-up" so i can add some hint box for CF. For example
import com.onresolve.jira.groovy.user.FormField
FormField selectlist1 = getFieldById("customfield_35743")
FormField Testfield1 = getFieldById("customfield_36079")
FormField Testfield2 = getFieldById("customfield_36080")
def hint1 = """
<div class=\"aui-message hint\">
<p>Some information</p>
<p>Here you can see some info about CF - TestField 1</p>
</div>
"""
def hint2 = """
<div class=\"aui-message hint\">
<p>Some information</p>
<p>Here you can see some info about CF - TestField 2</p>
</div>
"""
log.debug("dropdown value" + selectlist1.getValue())
if (selectlist1.getValue() == "B") {
Testfield1.setHidden(false).setHelpText(hint1);
Testfield1.setRequired(true);
Testfield2.setHidden(true);
} else if (selectlist1.getValue() == "C") {
Testfield1.setHidden(true);
Testfield1.setRequired(false);
Testfield2.setHidden(false).setHelpText(hint2);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sorry for explaining it wrong not like pop up it should be visible thats what i was trying to mention there. apologies for the mistake done .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.