How to access Component properties in calculated field

Deb Martinez August 7, 2015

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();

-->

1 answer

0 votes
David _old account_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 9, 2015

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();

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events