Add Custom Activity Log Action Macro

From SDU
Revision as of 16:21, 5 November 2008 by Gityerfix (Talk | contribs)

Jump to: navigation, search
To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.

Overview

This Article provides the syntax for adding Action Macros that allow for a wide range of Activity Log entries. Instead of having to create a new Action Macro for each custom Activity Log entry, the Action Macros that follow utilize the text field of the Event to determine the information to enter into the Activity Log. And since an Action Macro can be used by multiple Events, each event can have it's own unique Activity Log entry.

Procedures

Step 1. Upload New Action Macros

The first step is to add the new Action Macros. This is done via a data load since Service Desk does not provide a GUI method of created or updating Action Macros.

Create a text file using the following syntax: <source lang=text>TABLE Spell_Macro del description fragment lock_object ob_type sym type usr_integer1 usr_integer2 usr_integer3 usr_string2 usr_string3 usr_string4

{ "0" ,"add an activty log listed in the event's \"Text Field\" to the request", "// add an activity log. Requires the macro be locked.\\0012uuid log_userid;\\0012log_userid = (uuid)\"793ED69B4E87A545BD8E911834D829FC\";\\0012 \\0012// get info from event to store in log description\\0012 \\0012string log;\\0012log = expand(event_tmpl.user_smag);\\0012 \\0012send_wait(0, this, \"log_event\", group_leader, log_userid, log);\\0012if (msg_error()) {\\0012 logf(ERROR, format(\"Macro event error '%s'\", msg[0]));\\0012}", "0" ,"cr" ,"Add a Custom Activity Log" ,"ACT", "" ,"" ,"" ,"" ,"" ,"" } { "0" ,"add an activty log listed in the event's \"Text Field\" to the change order", "// add an activity log. Requires the macro be locked.\\0012uuid log_userid;\\0012log_userid = (uuid)\"793ED69B4E87A545BD8E911834D829FC\";\\0012 \\0012// get info from event to store in log description\\0012 \\0012string log;\\0012log = expand(event_tmpl.user_smag);\\0012 \\0012send_wait(0, this, \"log_event\", group_leader, log_userid, log);\\0012if (msg_error()) {\\0012 logf(ERROR, format(\"Macro event error '%s'\", msg[0]));\\0012}", "0" ,"chg" ,"Add a Custom CHG Activity Log" ,"ACT", "" ,"" ,"" ,"" ,"" ,"" } { "0" ,"add an activty log listed in the event's \"Text Field\" to the issue", "// add an activity log. Requires the macro be locked.\\0012uuid log_userid;\\0012log_userid = (uuid)\"793ED69B4E87A545BD8E911834D829FC\";\\0012 \\0012// get info from event to store in log description\\0012 \\0012string log;\\0012log = expand(event_tmpl.user_smag);\\0012 \\0012send_wait(0, this, \"log_event\", group_leader, log_userid, log);\\0012if (msg_error()) {\\0012 logf(ERROR, format(\"Macro event error '%s'\", msg[0]));\\0012}", "0" ,"iss" ,"Add a Custom ISS Activity Log" ,"ACT", "" ,"" ,"" ,"" ,"" ,"" }</source>

Then run the following command:

pdm_load -f yourfile.txt -i -v

This process will add three new Action Macros.

Step 2. Using the New Action Macros

r11.x Screenshot - Event Configuration

To use these Action Macros you simply add them to the desired Event. Within the Text field of the Event you add the syntax you want to be added to the Activity Log.

See Also

Action Macro to Log Solution and Resolve Ticket