Copy multi-group picker value to X-Header


I am trying to manipulate to export some issue's properties as X-Headers in the e-mail's subject to facilitate filtering in the mailing clients.

I have a custom field of multi-group picker type that I would like to export it. Therefore, I am using the following lines of code:

CustomFieldManager customFieldManager = ComponentManager.getInstance().getCustomFieldManager();
CustomField customField = customFieldManager.getCustomFieldObjectByName("Group Name");
Object customFieldValue = issue.getCustomFieldValue( customField );

And here starts my problem. I am trying to copy the "customFieldValue" object's value to a StringBuffer and immediately after include it in the e-mail's subject field but I get a value like [com.atlassian.crowd.embedded.impl.ImmutableGroup@xxxxx].

I believe my problem is that I cannot handle properly the customFieldValue as Group object.

Any hints?


1 answer

reading the API documentation (, I notice that method getCustomField returns:

"A custom field's value. Will be a List, User, Timestamp etc, depending on custom field type.".

So my question may be a little bit more targeted, what will be the return value for a "multi group picker"? Is it going to be a "Group" type? Something else?

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

818 views 2 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you