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,560,579
Community Members
 
Community Events
185
Community Groups

Show/Hide Fields on ITSM Request screen?

Edited

I am having trouble wrapping my head around this.  The ITSM Request screen is made BEFORE an issue exists.  So I think when I am calling field values, they are always showing as null.  Is this even possible?

I have tried many different things.  But currently I am trying to make a behavior and this is more or less what I am trying.  If I run this as an initializer, it ALWAYS hides the Description field.  I believe this is because the getFieldByID doesnt exist yet on the ITSM request screen?

(Sorry for the lack of a code block, not sure how to do that here)

def selectListField = getFieldById("Exception Template")
def selectListValue = selectListField.value
def textField = getFieldByName("Description")

if (selectListValue == null) {
textField.setHidden(true)
} else {
textField.setHidden(false)
}

Hoping someone can help guide me!

1 answer

Figured it out! I needed the customfield nameID, not it's full name.  This has some parts added as I changed the functionality from show/head to readonly true/false

 

def selectListField = getFieldById("customfield_12900")
def selectListValue = selectListField.value
def textField = getFieldByName("Description")
def text = "PreMade Text"
if (selectListValue == "Specific Selector Text Here") {
textField.setFormValue(text)
textField.setReadOnly(true)
} else {
textField.setHidden(false)
textField.setReadOnly(false)
textField.setFormValue(" ")
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events