how can I catch the sender from issues generated from incoming mail?

Clelia Giardina May 21, 2021

Hi,
I configured incoming e-mail to create a new task for every e-mail recevied to a specific address of my company.
I configured this address as mail handler and I don't allowed the creation of a users for the sender - it was not needed for my solution.

I would like to retrieve the e-mail sender and store it in a custom field of my new task (not as reporter or watcher).
Is that possible?
It would be perfect be able to retrieve also the "cc" adress (if presents).

I hope you can help me.
Thank you!
Clelia

1 comment

Comment

Log in or Sign up to comment
Bill Sheboy
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.
May 21, 2021

Hi @Clelia Giardina 

Full disclosure that I haven't set up an email handler in a while...

I recall when you do not create new Jira users from the sender email address, that email address is added to the end of the description field.  You could use an automation for Jira rule to find/parse that out and put it into your custom field.  Please look here to get you started with automation rules:

I believe that if you haven't selected any of the options to manage CC/BCC as Jira users, those email addresses are not saved with the created issue.

Best regards,
Bill

Clelia Giardina May 21, 2021

Hi @Bill Sheboy , thank you for your answer!
I saw that the sender is at the end on my new task.
I know Jira Automation, and I'm using it exactly for this my problem.
I will try with your suggestions to found a solution for my process.

It seems it is not so easy, because I saw many different way to trace the sender address.
I sent two different e-mail (one from my work address and one from my personal) and I cant find a rule for apply a logic:

*first case - from my working address (the same of my Jira Account)*
----------------------------------------------------------------------------------------
[1] name.surname@mycompany.it

*second case - from my personal and external address *
[Created via e-mail received from: name surname <name.surname@blabla.com>]

I hoped someone had already bump into this need, and can share with me a smart way to manage this problem.

thanks for your tips!

Like # people like this
Bill Sheboy
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.
May 21, 2021

Wow, that is curious! 

Is the email address always on a separate and final line in the description?  If so, perhaps you could use the text function split() on newline to get at the last row, and then clean-up from there.  Maybe something like {{issue.description.split("\n").last}}

Try experimenting to see how that works.  And...I recommend creating a test rule on a manual trigger, and writing the results to the audit log.  Then you can work things out without needing to repeatedly send emails.  ;^)

Like Clelia Giardina likes this
Clelia Giardina May 21, 2021

Hi @[deleted] 

thank you again for your tips.

I changed my automation adding a new action for retrieve the sender using the string manipulation that you suggested.
I can't understand why not for all issues created the last row of description have the syntax declared from Jira documentation (and that you linked). There are some exceptions that escape from my rule!

anyway. For now, seems I managed the most of scenarios, and that will be fine for now!

for sure, I will accept any other suggestion for my question. Even for retrieve the "cc" addresses that seems been impossible to catch!

Like # people like this
TAGS
AUG Leaders

Atlassian Community Events