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.
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?
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.
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 ...
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