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

Read from description and set reporter for email requests

SheshaChandra June 11, 2022

Hi,

 

I'm automating an email request and below is my use case. 

When users send an email to createTicekt@test.com, an email request ticket will be created.  

Below is the sample from the email 

```

User Name :  Krishna

User email : Krishna@test.com

User location : Las Vegas

```

I'm writing the automation to read the description when the new ticket is created. I need to pick the value from User email and set him as the reporter. 

In the above case Krishna@test.com will be reporter.  I'm trying to use smart values to get the user email from the description and the below is the regex i'm using. 

{{issue.description.match(".*(?<=User email :).*")}}

Can someone provide suggestion on the regex to get the user email as the above regex is not working ? 

Thank you

2 answers

0 votes
SheshaChandra August 18, 2022

I used the below regex to get the user email and it works. 

{{issue.description.match("((?<=Useremail\:) [a-zA-Z0-9- ]+)")}}

Florian PEREZ
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 18, 2022

Hey ! 

Happy to see that solve your issue.

 

Don’t forget to accept answers if it help you ! 

0 votes
Florian PEREZ
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 12, 2022

Hello, 

AFAIK You should not need to get this information by building a regex.

When user open a request by mail, JSM keep the value so you can use it. You should be able to get the value with something like {{creator.email}} (not tested but it should be something like that).

The use case you mention could also be someone open the ticket in behalf of someone else. In this case there is 2 ways, first you can add them as cc on the mail and use the value of viewers (user in cc are added as viewer). 

If you want to check more about you regex and your not on a free plan you should open a ticket to the atlassian support. I think it should be a really quick for them to help you on this one. 

Hope this help. 

SheshaChandra July 12, 2022

Thanks @Florian PEREZ . I will open a ticket with Atlassian support for regex. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events