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

How to add a select cascade field value in a custom email [script runner postfunction]

Hi Guys, 

I'm following the documentation to send Send a custom email using a custom field https://scriptrunner.adaptavist.com/4.3.6/jira/builtin-scripts.html. It works, but with some problems.

The code

Custom field : <% out <<
issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("my select cascade field")) %> <

 

I'm using a select cascade field and the preview shows this.

Custom field : [null:JIRA SOFTWARE, 1:jira-users - Jira Users] 

Why apperas the nulll and number 1?

Can I remove this values?

 

1 answer

1 accepted

2 votes
Answer accepted

see https://community.atlassian.com/t5/Jira-questions/How-to-add-a-multi-select-dropdown-custom-field-value-to-custom/qaq-p/854441

Custom field value: <% out << issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("MySelect"))*.getValue().join(', ') %>

For a multiselect list getCustomFieldValue() returns a collection of Option object. With *.getValue() you convert this collection to a collection of the values of these Option objects. The value is the text the user sees. With join(', ') you convert this collection to one string, if there are multiple values these are separated by a comma.

@Alexander Pappert ,

Your script worked, thank so much for your help.

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Jira Software

Presenting the "Best of 2020" Jira Software roundup!

Catch up with Atlassian Product Managers in our 2020 Demo Den round-up! From Advanced Roadmaps to Code in Jira to Next-Gen Workflows, check out the videos below to help up-level your work in the new ...

7,193 views 8 28
Join discussion

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