Email inbound actions

User_267
Tera Contributor

I have a requirement like, when a email has been sent, the response from the user has to be captured in Requested item worknotes.

How to configure email inbound for this?

6 REPLIES 6

Anand Kumar P
Giga Patron
Giga Patron

Hi @User_267,

Create new inbound email action use condition as per your requirement and use below code 

var subject = email.subject.toString();// email subject contains request item number

var emailResponse = email.body_text;

var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('number', subject))

ritm.query();

if (ritm.next())

{
ritm.work_notes = "Email Response:\n" + emailResponse;
ritm.update();
}

Please mark it as solution proposed and helpful if it works for you.

Thanks,

Anand

 

It's not for one ritm, so i cannot update ritm number in script

Hi @User_267,

You mean in one inbound email subject you have multiple RITM numbers?

Thanks,

Anand

Not like that, there will be multiple users so multiple catalog items will be submitted and we get different ritm's for every catalog item right.so I cannot mention only one ritm number right in script