The CreatorCon Call for Content is officially open! Get started here.

Inbound email action - create ticket and update with Subject of email

maneesh3
Tera Contributor

Hi Team,

 

I have an requirement to create and update ticket with subject line instead of watermark. Client will send emails from JIRA system. They will have unique subject for each ticket sending to SNOW.

for example:

 

Subject: JIRA TKT NO 74 

 

So I need now to create ticket for the first email and next emails with same subject should be updated. Client did not have feasibility to send thread of emails , and everytime they send as new emails.

 

Please suggest code to do in inbound email actions

 

Help much appreciated. Thank you!

1 ACCEPTED SOLUTION

Hi @maneesh3,

 

If your subject is [JIRA] (C2SD-74) TEST  and you wants C2SD-74. then you can use the below regex to get the result

var jiraTicketNo = subjectStr.match(/\(([^)]+)\)/)[1].toString();

and comment out var regExSmit = /Task\d{6}/; line

 

Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Thanks
Vijay Balotia

 

View solution in original post

16 REPLIES 16

Hi @maneesh3,

 

Can you check correlation_id field is available on case table or not? if not then use the field where you are storing Jira Ticket.

 

Thanks,

Vijay Balotia

Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Thanks
Vijay Balotia

Hi Vijay,

 

I have corelation id field but getting different values for 2 new create cases raised for same subject:

 

maneesh3_1-1695206563341.png

 

maneesh3_2-1695206575447.pngmaneesh3_3-1695206588426.png

 

 

Please help!

 

Hi Vijay,

 

Can you please help here.

 

Thanks

Hi @maneesh3,

Can you please do this in line number 3 and print this in logs and see what value you are getting.

 

  var jiraTicketNo = subjectStr.match(regExSmit).toString();

 


Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Thanks
Vijay Balotia

Hi Vijay,

 

Modified the line and tested the scenario, now I am getting Correlation ID same but still it is creating duplicate tickets for same subject

 

correlation ID  = Task110017

 

maneesh3_0-1695286339680.png

received emails like belowmaneesh3_1-1695286375742.png

 

maneesh3_2-1695286394457.png