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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Get the value of a custom field Edited

Hello Team,

I have two custom fields which are visible & required only in one of the issue type of a project, in rest all issue type it's not required. I am doing it using behavior.

Now there is further requirement where in, if the value of first custom field which is single select type is "Yes", second custom field which is of number of attachment type should be made required.

I am running a server side script as below, but its not working. Can someone help with it ?

def approval = getFieldById("customfield_xxxxx")

approval.setHidden(true);

def attachment = getFieldById("customfield_xxxxx")

attachment.setHidden(true);
String issueType = getIssueContext().getIssueType().getName()

if (issueType == "New Request") {

approval.setHidden(false);

approval.setRequired(true);   

if ("Yes" in approval.value) {

attachment.setHidden(false);

attachment.setRequired(true); }

}

 

1 answer

1 accepted

0 votes
Answer accepted

Hello Guys, does anyone have any solution to this ?

The code is fine, something was wrong with the custom field, deleted a field & created new one & it works.

Suggest an answer

Log in or Sign up to answer
TAGS

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