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

Variables change off of inbound action keywords in body of email.

Justin Dirks1
Tera Expert

Hello!

 

I am needing to change a variable in an incident based on the keywords of High or significant within the body of an email. If the email contains Severe then I would want to have the Priority changed to 1-High and if the body contains Warning I would want the Priority to be set to 2-Significant.

 

Any help with this would be great!

 

Thanks!

1 ACCEPTED SOLUTION

So I was able to get Critical to work but not what I needed for Warning. 

 

var emailBody = email.body;

	if (emailBody.indexOf ("Critical") != -1) {

		current.impact = 1;
		current.urgency = 1;

	} else if (emailBody.indexOf ("Warning") != -1) {
		
		current.impact = 1;
		current.urgency = 2;
	}


	current.insert();

 

 

View solution in original post

12 REPLIES 12

AshishKM
Kilo Patron
Kilo Patron

Hi @Justin Dirks1 ,

You can update the Inbound Email Action and read email body for keyword via email.body and apply indexOf for checking the keywork "Severe" or "Warning". 

 

Make sure you update the impact & urgency because priority depends on these two fields value and "Priority Data Lookups" rule applied when incident form is saved.

 

AshishKMishra_0-1699990515387.png

-Thanks,

AshishKMishra


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Thank you! I am giving it a try now. 

Sure, let me know if it is working or not. 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

So I was able to get Critical to work but not what I needed for Warning. 

 

var emailBody = email.body;

	if (emailBody.indexOf ("Critical") != -1) {

		current.impact = 1;
		current.urgency = 1;

	} else if (emailBody.indexOf ("Warning") != -1) {
		
		current.impact = 1;
		current.urgency = 2;
	}


	current.insert();