The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Inbound email action to change incident state

Travers M
Mega Guru

We've gone in and configured the system to allow incoming emails but only via reply.   Now I'm faced with a different task.   We have a state on the incidents of Need More Information which will pause an SLA.   I need to add something that will change the state of the incident to a work in progress that will then resume the SLA as we are no longer waiting on the user.     Is inbound email action even the best way to approach this or should I look elsewhere?

1 ACCEPTED SOLUTION

It might be as simple as this if the 'Need for Information' is a value of 4 and work in progress is a value of 2



if ((email.from == current.caller_id.email) && (current.incident_state == 4)){          


                current.incident_state = 2;


  }



or if you use the state field instead of incident state:


if ((email.from == current.caller_id.email) && (current.state == 4)){          


                current.state = 2;


  }



I hope this helps.



Best regards,
David


View solution in original post

13 REPLIES 13

Hello Chris,


The change might be happening as you have set, but you might also be hitting against a business rule that automatically updates the incident state value from New to Active.   Are you wanting to make sure that the assigned personnel are notified when the user responds?



Best regards,
David


Hi to all


I'm new programming in Service Now.


I'm trying to do a "Inbound email action" in order to close an incident sending an email to xxxx@service-now.com.


For example: I want to send an email to xxxx@service-now.com with the number of the incident in the subject, and change the incident_state to 6 or 7 (Resolved or Closed).



I have been reading this page:


http://wiki.servicenow.com/index.php?title=Inbound_Email_Actions#Matching_Incoming_Email_to_Existing...



But I don't know how to capture the incident from the subject and update the incident..



¿It's that possible?



Thank you very much!


Hi Franco,



Sorry for late reply.It is possible to meet your requirement. Do you still have this as an open item?



Mateen


Hi Franco,



you can do something like that:


if (String(email.subject).indexOf("INC")!=-1){


  var index = String(email.subject).indexOf("INC");


  incident= String(email.subject).substring(index,index+10);


  var gr = new GlideRecord('incident');


  gr.addQuery('number',incident);


  //do whatever you want


}



With that you capture the number and then you look for it on the incident table.



Rergards