Hi Tanaji,

Below is the script written in inbound action :

(Note:when customer replies through email the below script will workout).

 

gs.include('validators');

if (current.getTableName() == "incident") {
//current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
var index = email.subject.indexOf("INC");
var incNumber = email.subject.substring(index,index+10);
//gs.log('The incident number:' +incNumber);
var gr = new GlideRecord('incident');
gr.addQuery('number',incNumber);
gr.query();
while(gr.next())
{
if ((email.from == current.caller_id.email) && (current.state == 9) && (current.hold_reason == 1))
{
current.state = 2;

current.hold_reason==''; //Have added this line to make pending reason go empty but did not help.

}
current.update();
}
}