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?
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.
Your script worked, thank so much for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.