It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
Hi All,
I've just started using EazyBI and I'm adding some extra fields to it using the MISC custom fields add-in.
So far so good for most simple things I need, however I am now trying a more complex field to store all Components selected on an issue into a separate custom text field as a comma delimitted string.
I just can't seem to get the right syntax or I'm missing something obvious.
On the EazyBI website I can see this example for Fix Versions:
<!-- @@Formula: import org.apache.commons.lang.StringUtils; StringUtils.join(issue.get("fixVersions"), ","); --> |
This works great for that field. I then tried issue.get("components") but that didn't work for me.
Looking through the API knowledge base for Components it seems I need to use issue.getComponents() to return a collection and then .getName() to return the name part of the collection?
Anyone know a simple way to grab all the names of the selected components and put them into a string?
Any help is much appreciated!
Hi Gareth,
I'm sure there're better and more clean ways, but this should work:
<!-- @@Formula:
import com.atlassian.jira.bc.project.component.ProjectComponent;
import java.lang.StringBuffer;
StringBuffer issueComponents = new StringBuffer();
for(ProjectComponent pc : issue.get("components")){
if(issueComponents.length() > 0) issueComponents.append(",");
issueComponents.append(pc.getName());
}
issueComponents.toString();
-->
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreAtlas Camp is our developer event which will take place in Barcelona, Spain from the 6th -7th of September . This is a great opportunity to meet other developers and get n...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.