pulling info from email to populate the short description

scottjus82
Kilo Guru

Hi

 

Using an inbound action I am trying to populate the short description with a line from the inbound email but my attempts have failed (again) I have tried using a script provided previously to be used in a record producer however thats failed. The email body will have the following lines, I want to pull the answers and add them to the short description stating New starter request for.....

 

 

First Name

Last Name

 

Any help would be greatly appreciated.

 

Regards

1 ACCEPTED SOLUTION

Have you tired using email.body.first_name (in lower case not upper case)



I think they may change the variables to all lower case when setting up the inbound integration.



Cheers,


Cameron


View solution in original post

19 REPLIES 19

Hey Steve,



I see you finally have the line current.short_description =email.body.FirstName;



However in the actual email you have FirstName :Dave



Can you remove the space after FirstName and before the ":" so that is reads FirstName:Dave



Once you have this I would be confident that it will populate.



Let us know your results.


There is nothing preventing an inbound action from creating a request in the request table.



Hopefully you are able to modify the inbound email to eliminate the spaces.


Harish Murikina
Tera Guru

Hi Steve,



var up_task_notes = new GlideRecord('incident');


up_task_notes.addQuery('number', task_num); // get number from subject


up_task_notes.query();


if(up_task_notes.next())


{


  up_task_notes.description = email.body_text; // Update description with email body text


  up_task_notes.update();


}




Regards,


Harish.


Mike Allen
Mega Sage

This is a shot in the dark, but in SQL, when there is a space in the column name, you are able to work with it by bracketing it.   So, maybe [First Name] might work?   I have never tried this in JavaScript, but it might be worth the try.


mgordon
Giga Contributor

hello,


curious if you have ever got this to work.


i am trying to do the same thing where i want to take the body part where i see



Subject:server xyz is down


and replace this with the short description.



tried a bunch of things, last code was


if(email.body.Subject !=undefined) {


current.short_description = email.body.Subject;


}



and it doesnt work for me..


appreciate if you can help.


thanks