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,467,803
Community Members
 
Community Events
177
Community Groups

Make "Attachment" field conditionally required using Behavior

Edited
Pete P Rising Star Jan 16, 2023

I need to make "Attachment" a required field based on the value of a custom field.   When I set the Attachment as "required" in the field configuration page of the request type it does work.  However using behaviour it doesn't work.  It does toggle the "(Required)" text however.  In my application if the custom field Terraform is "YES" (12821),  I need attachment to be required. 

Here is my simple script:

 

def Terraform = getFieldByName("Terraform")
def Attachment = getFieldByName("Attachment")
   
def TerraformValue = Terraform.getFormValue();

if (TerraformValue !="12821") // Yes
{

    Attachment.setRequired(false)
}
else
{

    Attachment.setRequired(true)

}

1 answer

1 accepted

1 vote
Answer accepted
Pete P Rising Star Jan 17, 2023

Thanks @Mohamed Benziane ~

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.2.2
TAGS

Atlassian Community Events