Best Practices: assigning incidents by Inbound Action?

JP-ODU
Tera Guru

Over the years, I've been asked to recognize incoming emails by various criteria (typically sender email address or subject line) and make various assignments to assignment group, status, caller, etc. It seemed to me that the most expedient means of doing this was to add additional lines of script to our Create Incident inbound action. Ex:

 

	if (email.subject.indexOf('Account Compromise, ServiceNow Automation 000001') >= 0){
		current.assignment_group.setDisplayValue('IT Security');
		current.state = 6;
		current.category.setDisplayValue('X');
		current.cmdb_ci.setDisplayValue('Y');
	if(email.body.user!=undefined){
   		current.caller_id=email.body.user;
		current.short_description="Account Compromise, " + email.body.user + ", ServiceNow Automation 000001";}
    }

 

It's reached the point that I have 10 of these layered into our Inbound Action. Is that ok? Can I do this, indefinitely? How much is too much? Or: what is the preferred method to deal with a request like this to recognize incoming emails?

1 ACCEPTED SOLUTION

arup_maji
Mega Guru

Hi @JP-ODU ,

You can use the conditions field in the inbound email action to check the various values and take the further action. Your mentioned way works as well but debugging becomes a little tricky there. For separate conditions you create new inbound email actions and make sure to check the stop processing box if you need not need to process further if match is found for optimization. By this way you will have more control on debug as for every email received, if there are any matching inbound action it will be there in email log, which make it more modular and easier to check for any issues but for your case it will show only one inbound action each time.

View solution in original post

1 REPLY 1

arup_maji
Mega Guru

Hi @JP-ODU ,

You can use the conditions field in the inbound email action to check the various values and take the further action. Your mentioned way works as well but debugging becomes a little tricky there. For separate conditions you create new inbound email actions and make sure to check the stop processing box if you need not need to process further if match is found for optimization. By this way you will have more control on debug as for every email received, if there are any matching inbound action it will be there in email log, which make it more modular and easier to check for any issues but for your case it will show only one inbound action each time.