Inbound email action - auto populate values in incident table from email body

nivethika
Tera Contributor

Hi,

How to populate fields value in incident table from email body using inbound action. once i send email with few parameters, automatically those parameter fields values should be mapped to that particular field in incident table.

example: suppose from email you send any parameter such as name of the

configuration item : Ansible 

category: Software 

assignment group: test group.

description : ansible incident test.

 

Thanks in advance,

Nivethika

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can get value of those like this

there is particular syntax to get the value from name: value pair

var description = email.body.description.trim();

var group = email.body.assignment_group.trim();

var category = email.body.category.trim();

var ci = email.body.configuration_item.trim();

current.category = category;

current.description = description;

current.setDisplayValue('cmdb_ci', ci);

current.setDisplayValue('assignment_group', group);

Parsing Inbound Email

 

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thank you Ankur.

 

I tried using the above method, let me attach here. please correct me if i am wrong.

 

inbound email action - when to run type: new and script below

find_real_file.png

from mail i have sent like this

find_real_file.png

find_real_file.png

 

It didnt map in incident table.

Please help me out.

Hi,

did you check in logs what came for those 4 values?

Are you sure your inbound action ran?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

yes i checked by giving info message -

gs.info("parameter test"+ category + description + ci+ group);

find_real_file.png