Inbound email flow: Update Record based on parts of the email subject
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 12:46 AM
Is this even possible?
The case: we recieive multiple emails from our vendor, when they have alarms on our infrastructure.
In the subject on these emails, they have a ticket number, and a text telling us wether the ticket has been opened, updated or resolved. "incident xxxx regarding xxxx has been opened/updated/resolved"
I have created an inbound email flow, to create a new incident with these triggers:
User ID.email is [emailadress)
AND
Subject contains "opened"
so far so good
What I can't figure out, is how to add any updates to existing ticket, when the intitial ticket is updated or resolved.
I guess the trigger would be "subject contains update or resolved", but how do I make the system understand what incident to update?
Any suggestions will be appreciated 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 01:39 AM
Hi @LFM
Can you please share your example subject line? the solution is you need to retrieve ticket number from subject line and then need to glide that record to update basis on subject.
so, below are the two things
1. You need to retrieve ticket number from subject
2. You need to search operation updated or resolved
And then need to glide basis on number to update the record if it's opened then you need to raise new incident no need to fetch number in this case.
Below example you can use It does not contain number fetching code because I don't have sample subject but basis on assumption, I created the example:
//var subjectStr = email.subject;
var resolveVal = subjectStr.includes("resolved")
var updateVal = subjectStr.includes("update")
if(resolveVal==true)
{
Please write code to resolve the record
}
else if(updateVal==true)
{
Please write code to resolve the record
}
I hope this helps
Please mark my answer correct if this helps you
Thanks
Mohit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 02:18 AM
Thank you, Mohit
Example:
[Company] Incident TIINC0214264 regarding "Host down [network item]" has been opened
[Company] Incident TIINC0214264 regarding "Host down [network item]" has been updated
[Company] Incident TIINC0214264 regarding "Host down [network item]" has been resolved
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 02:43 AM
Hi @LFM
Thanks, for providing the sample subject I made changes in code and fetch the number as well now it's ready for you to rock on.
var subjectStr = email.subject;
var keyword="TIIN";
var key = subjectStr.indexOf(keyword); //Assuming this text would never change
gs.print(key)
if(key > 0){
var number = subjectStr.substring(key, 29); // you can pick your number in query to update the record
gs.print('check'+number); //Try printing number
}
var resolveVal = subjectStr.includes("resolved")
var updateVal = subjectStr.includes("update")
var openVal= subjectStr.includes("opened")
if(resolveVal==true)
{
Please write code to resolve the record
}
else if(updateVal==true)
{
Please write code to resolve the record
}
else if(openVal== true)
{
Please write code to create the record
}
I hope this helps
Please mark my answer correct if this helps you
Thanks
Mohit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 05:03 AM
Thank you 🙂 , I will have a look a it, and see if I can work this out. This is for creating inbound e-mail action, right, not by using flow designer?