Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

based on custom field selection other custom field should pop up for the user

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 .

1 answer

1 accepted

1 vote
Answer accepted

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.

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);
}

Like Vikrant Yadav likes this

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 .

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

☕️ Monday coffee with Jexo: Weekly Atlassian news roundup | 21st June 2021

Hi community 👋, as every Monday we're bringing you a quick update on what happened in the Atlassian ecosystem last week. There were a few interesting events like for example the announcement of th...

59 views 0 6
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