Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to store the "to" and the "cc" recipient of an email with JEMH

Chiara Squilloni June 15, 2018

Hi everyone,

we are evaluating the JEMH plugin.

Since know we used a plugin developed by our own.

I try many funcionalities by JEMH but I dint' already get these:

  • I want to store in a custom fields the "to" recipient if an incoming email is send not only to the email of the profile but also to other email (for example to: email1@example.com; email2@example.com; email3@example.com
  • I want to store *all* the cc recipient of an incoming email, not only the first one

Please any suggestion? Is possibile to do these by using JEMH?

1 answer

0 votes
Andy Brook
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.
June 28, 2018

Hi there,

Why JEMH splits Sender and Particpants

> I want to store in a custom fields the "to"

What happens when there are 20 recipients in To: ? The reason JEMH works as it does is simply because there is The Sender and Participants.  The Participants can exist on To: or Cc: lines, mailbox addresses can exist in either set. So, JEMH initially extracts:

1) the sender

2) non-mailbox Participants

That's great, but at this point, JEMH starts to figure out 'who' those adresses are in JIRA, eg the Sender may be a User or JSD Customer, the other Participants may individually be a User, a JSD Request Participant or just an email user.  JEMH splits out these addresses and handles them differently depending on what they are.

 

How you do what you want anyway

BEWARE.  If you go storing email addresses in a custom field without paying attention to the nature of the recipient (eg a mailbox address) and you go and use this for notification purposes,  you will introduce a mail loop.

The path to take here is with a Velocity Scripted Custom Field Default, defined within a Project Mapping.  You can extract all the To: recipients from the $message, and just dump that out into a TEXT multi-line field.

https://thepluginpeople.atlassian.net/wiki/spaces/JEMH/pages/143491123/Use+Custom+Field+Defaults

The magic to get an array of recipients is:

#foreach ($aTo in $message.getRecipients($jemhUtils.getRecipientType('to')) )

$aTo.getAddress() ,

#end

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events