Video Screencast Help
Endpoint Management Community Blog

Using the History List Macro

Created: 06 Oct 2006 • Updated: 11 Jun 2007 • 7 comments
John Doyle's picture
0 0 Votes
Login to vote

The HISTORY_LIST macro allows you to create a HTML table in e-mails that you send out from the Helpdesk containing the complete history of a workitem.

The following example, taken from the reference manual, shows how to create a simple table.

<TABLE>HISTORY_LIST[[<TD>$$workitem_version$$
</TD><TD>$$workitem_modified_on$$
</TD><TD>$$workitem_modified_by_worker_name$$</TD>]]</TABLE>

This table will contain the version number, the modification date and the name of the worker that modified the incident.

We can use the same format to output the comments:

<TABLE>HISTORY_LIST[[<TD>$$workitem_version$$</
TD><TD>$$workitem_modified_on$$</
TD><TD>$$workitem_comment$$</TD>]]</TABLE>

However, if this is used in an e-mail to the users, they will see all the comments added to the incident including ones which were set as not visible to guests. In order to remove these comments I came up with the following code:

<TABLE>
REGEX{{HISTORY_LIST[[<TR><TD TAG=$$workitem_comment_visible_to_guest$$>$$workitem_modified_on$$</TD></TR><TR><TD TAG=$$workitem_comment_visible_to_guest$$>$$workitem_comment$$</TD></TR>]]}}{{(<TR><TD TAG=0)(.*?)(</TR>)}}{{ }}
</TABLE>

Note: For the above to work the entire REGEX statement must be entered as a single line in the e-mail template.

Comments 7 CommentsJump to latest comment

Scott Hardie's picture

This tip will prove very useful for supporting some customers using handhelds as well for support. Thanks for posting it.

James "Scott" Hardie
Vice President of Technology Services
shardie@xcendgroup.com
http://www.xcendgroup.com

James "Scott" Hardie
Security Architect
Security Business Practice
Symantec Corporation
www.symantec.com
__________________________________
Office: (810) 588 9464
Mobile: (810) 588 9464<

0
Login to vote
shan's picture

We correspond alot through email from our Incidents and this will help in keeping the contact informed on what the email is about and what information we need from them.

Thank you.

+2
Login to vote
syarlett's picture

Hi,

Is there a way to make the Date in BOLD, thought it might just seperate the different days better.

Otherwise very usefull edit!

-2
Login to vote
rahiz's picture

Hi,

How can I do this and where i need to make modifications.

+2
Login to vote
cybi99's picture

$$workitem_modified_by_worker_name$$ does not work in our e-mail template.

on the other hand $$workitem_modified_on$$ works,
so does $$workitem_status_lookup_value$$
so does $$workitem_modified_by_worker_ID$$

Can anyone help. I would like the e-mail history table to show the modified by worker name

-3
Login to vote
JeffPeters's picture

the correct tag is $$modified_by_worker_name$$

My version of the same thing using his code:
                          <TABLE>
                                  REGEX{{HISTORY_LIST[[<TR><TD TAG=$$workitem_comment_visible_to_guest$$>$$workitem_modified_on$$ $$modified_by_worker_name$$</TD></TR><TR><TD class="txtMsgValue" TAG=$$workitem_comment_visible_to_guest$$>$$workitem_comment$$</TD></TR>]]}}{{(<TR><TD TAG=0)(.*?)(</TR>)}}{{ }}
                          </TABLE>                  

(REGEX All on one line though)

Bolds the Comments themselves. Includes the worker name next to date.

0
Login to vote
Cenveo_Ben's picture

I cannot get this to work. Can anyone help me. Here is what I have for code. (everything in the REGEX is on one line, each of the <TABLE> </TABLE> are on their own lines above and below respectivly.

<TABLE>

REGEX{{HISTORY_LIST[[<TR><TD class="txtMsgValue" valign="top" bgcolor="#C0D399" TAG=$$workitem_comment_visible_to_guest$$>$$workitem_modified_on$$ $$modified_by_worker_name$$</TD></TR><TR><TD class="txtMsgValue" TAG=$$workitem_comment_visible_to_guest$$>$$workitem_comment$$</TD></TR>]]}}{{(<TR><TD TAG=0)(.*?)(</TR>)}}{{ }}

</TABLE>

+2
Login to vote