- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2013 11:46 AM
does this do what you want? you said you wanted it to update the ticket..I wasn't sure if that meant work notes or state.
table: email [sys_email]
when: after / update
condition: ((current.target_table == "incident") && (current.sys_mod_count == 1) && (current.sys_created_by != "system"))
script:
var inc_work_notes = "blah...email sent";
var inc_sys_id = current.instance;
var target = new GlideRecord('incident');
target.addQuery('sys_id', inc_sys_id);
target.query(); // Issue the query to the database to get relevant records
while (target.next()) {
target.work_notes = inc_work_notes;
target.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2013 01:05 PM
YES! This works beautifully. Thank you very much for the quick reply and resolution. I actually wonder what this condition does: sys_mod_count == 1?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2013 01:09 PM
the first mod_count is when the Email window is first opened.
mod_count - 1 is after the user has sent the email
mod_count - 2 was after the system processed the email
I think I had previously tracked it by looking at the the different times a message was updated in the mail logs. It was awhile ago when I first looked at this so I may not be correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2013 01:33 PM
It makes sense of what you are saying. I tried to look at the email log and I noticed there are few different values for sys_mod_count: 0, 1, 2, 3 and 9. Tried to google what those number means and couldn't find anything. I guess I will keep digging and see if anything comes up. Again, thanks for your help and explanation. I can't imagine how I am going to figure this out myself 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2013 07:35 AM
I would like to achieve something similar with email client. I need to update a field(it should be a number or text) in the outage plugin by sending an email from the incident that has an outage through email client. Can you point me on the right direction? Thanks!