Add email in additional comments

shaily soni
Tera Contributor

Hello,
My requirement is that, email received is listed in the activity, but the content of the email is not added into the incident additional comments.
When an email is received for a task, the body of the email should be added as additional comments.
please answer ASAP.

1 REPLY 1

Community Alums
Not applicable

Hi @shaily soni ,

Use one of the existing inbound actions that does this as a model. For example, the Update Problem inbound email action does this in the script of the Action section:

if (current.getTableName() == "problem") {
current.work_notes = "reply from: " + email.origemail + "\n\n" + email.body_text;
...
current.update();
}

You can reuse this code, changing the target table name from problem to the intended target table.

The above code snippet copies the email into the Work Notes [work_notes] field. To copy into the Additional Comments [comments] field, instead, replace current.work_notes with current.comments in the script.