I am using the Misc Custom Fields add-on and I want to access the name property of a project component. How do I get to the name?
<!-- @@Formula:
issue.get("components").iterator().next();
-->
First of all, you should protect your formula against the case when there is no components:
if (issue.get("components")==null || issue.get("components").isEmpty()) return null;
And then to return the component name:
return issue.get("components").iterator().next().getName();
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.