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

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • 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

How to write postfunction to set values in a custom field based on values selected in another field

Hi all,

I have a custom field called teams with several values such as a,b,c,d,...  I have another custom field called sub-team with different values such as 1,2,3,4...  I want to create a postfunction that will set the sub-team based on the value chosen in team.  I'm wondering what script I would create to do that.  

1 answer

0 votes

This might help - - strip the bit about reading down links and apply the field (after translating) to the current issue.

Thanks Nic, but that's not quite what I'm looking for.  I want the workflow to set a second custom field based on what's selected in a first custom field.

In other words, If first_field = "A,B", then second_field = "1,2".  If first_field = "C,D,E", then second_field = "3".  The values in the fields for both the first_field and second_field are not the same.

Both fields are singleSelect Fields.

Yes, I know it's not exactly what you need, but it is code that will write the sort of changes you want to make.  You just need to adjust it to do what you need.

Suggest an answer

Log in or Sign up to answer

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