
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 02:47 AM
Hi,
I have a query regarding inbound actions.
At the moment, we have an inbound action for replies, that takes the relevant info from the e-mail and puts it into the "comments" of the incident.
However, in the activity log, the full e-mail itself is also posted, which can be expanded/collapsed. In this example, the "Email received" contains the same content as the additional comments, when expanded:
My query is, is it possible to have the e-mail logged against the incident, without an inbound action also writing to the incident comments? The rule itself does the work - modifying that is no issue. But if I disable the rule, the e-mail is not logged against the incident. It seems the inbound action HAS to perform some update on the incident record, for the e-mail log to be attached to it, else it is discarded/ignored.
I've probably got another solution sorted out to help keep things tidy, but I'm asking more out of curiosity as my various tests proved fruitless.
Thanks in advance for any pointers.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 08:22 PM
You could also try just updating the value for 'sys_updated_on' and/or 'sys_updated_by'. Just tested on my PDI and this seems to do the job... the email shows in Activity without adding any additional comments by updating 'sys_updated_by' with the current user.
-Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 06:17 PM
Hi Russ,
As I understand it you want an email to appear on he Acitivty Log without adding the email body contents to Additional Comments (or worknotes)? As you've found, for an email to be associated with a particular incident and appear on the Activity Log the relevant Inbound Action needs to actually change something on the incident record.
I tested this and found it's good enough to change any field, so you could add a simple integer 'flag' field to incident (e.g. email_recieved) and have the Inbound Action keep flipping it to a different random number to ensure the Inbound Action always has an update to do.
For my test I used this Inbound Action script (I used the state field and set it to a random number):
gs.include('validators');
if (current.getTableName() == "incident") {
var gr = current;
if (email.subject.toLowerCase().indexOf("please reopen") >= 0)
gr = new Incident().reopen(gr, email) || gr;
//gr.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
gr.state =
Math.floor((Math.random() * 9000) + 1).toFixed(0); // random number
if (gs.hasRole("itil")) {
if (email.body.assign != undefined)
gr.assigned_to = email.body.assign;
if (email.body.priority != undefined && isNumeric(email.body.priority))
gr.priority = email.body.priority;
}
gr.update();
}
I get the result you see in the screenshot, no addition comment is added but there is a notification about the change in the state field. Hope this helps.
Tim

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 08:22 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2017 01:02 AM
Thank you both for the replies. Both good solutions which will do what I need. Cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 07:52 PM
I know this is an older and answered post, but just wanted to add another option that might be useful for people.
Since the email appearing in the activity feed is based upon the Target being set for the email, you can manually set this in the script without needing to perform an update/insert on the variable current (which is the usual way the Target is set):
sys_email.instance = current.sys_id;
sys_email.target_table = current.getTableName();