CA Service Management

 View Only
  • 1.  Activity Log - Show Specific Data

    Posted Mar 22, 2019 03:31 PM

    When a ticket is initially created, the tickets activity log does not show what the data is originally set as for the following fields (Assignee and Group). Currently the activity log only shows the data for the previous and next when the ticket is transferred.


    1. Is there a way for me to set it up to show what the data is set as when the ticket is initially created?
    2. Do I need to create activity associations for those fields?
      • If so, what would the activity type be as its not really a field update since the field is initially blank when a new ticket is created.
    3. Can I just add the "System Description" to the list_alg,htmp file to accomplish this?
      • <PDM_MACRO name=dtlStartRow>

        <PDM_MACRO name=dtlReadonly hdr="System Description" attr=action_desc colspan=3>




    thank you


  • 2.  Re: Activity Log - Show Specific Data

    Posted Mar 25, 2019 02:54 AM

    Or maybe SPL would be the way to handle this, as it is better at triggers when data changes.


    Or maybe turn on auditing for those fields?


    Anyone have suggestions? I know this comes up occassionally.


    Thanks, Kyle_R.

  • 3.  Re: Activity Log - Show Specific Data

    Posted Mar 25, 2019 04:37 AM

    Saving a new ticket only fires the activity notification 'Initial'.  I don't think an activity association added on assignee and group would fire on the first save, and if it did fire you would have to suppress it for Transfer.

    I'd be inclined to follow Kyle's suggestion and either:

    a) fire a comment macro from the Initial notification (add a Log Comment, perhaps - or even a Multiple Notification, for which you can use the message template to show assignee and group) and add the Assignee and Group to the text for the new comment; or

    b) add a trigger to the 'alg' object that edits the description for an Initial activity log record to append the assignee and group.

    Hope that helps...



  • 4.  Re: Activity Log - Show Specific Data

    Posted Mar 25, 2019 10:40 AM

    Pertaining to Kyle's suggestion of turning on auditing for those fields, this is already done.


    Not sure I follow or understand suggestion a completely. 


    How exactly would suggestion b (add trigger to the 'alg' object to append the assignee and group) be done?

    Can I just add the assignee and group to the first line of the active triggers (post_validate) and then also add the fields as columns there?


    When I look at the 'alg' object in the schema designer, I see it has the following settings:







  • 5.  Re: Activity Log - Show Specific Data

    Posted Mar 25, 2019 11:00 PM

    Here is one way to implement option 'a'.

    Create a macro to log the assignee and group.  This is based on the macro 'Add an Activity Log':

    Create an event that fires the macro:

    ...and add the event to the Initial activity notification.

    The new log entry will appear after the save.  You will probably not see it immediately in the activity log tab, only after refreshing the ticket display:

    The downside of this is obviously that we've added an extra event and the fact that it doesn't appear immediately in the ticket's view of the activity log.

    More on option 'b' later.



  • 6.  Re: Activity Log - Show Specific Data
    Best Answer

    Posted Mar 26, 2019 05:54 AM

    My approach to option 'b' would be as follows:

    1. Add a post-validate trigger to the 'alg' object firing for new activity logs of type 'INIT'.  Both files in site\mods\majic.


    OBJECT alg {
        TRIGGERS {
            POST_VALIDATE  zalgSetAssGrpDesc(id) 999
                FILTER( EVENT("INSERT") && (type == "INIT") );
        } ;
    } ;

    OBJECT alg {
        FACTORY {
            METHODS {
                zalgSetAssGrpDesc(int) ;
                } ;
            } ;
        } ;

    #define ZDEBUG 99
    void alg::zalgSetAssGrpDesc(...)
        // Run post_validate in the context of an Initial activity log 'alg' object,
        //  sets alg.description, recording the Assignee and Group.
        string method; method = "alg::zalgSetAssGrpDesc";
        // get info from ticket to store in log description
        string assgnComboNm;  assgnComboNm = "<not set>";
        uuid assgnUuid;
        string grpLastNm;  grpLastNm = "<not set>";
        uuid grpUuid;
        // Get Assignee combo name
        assgnUuid = (uuid)expand(format("&{'%s' = cr.persistent_id->assignee}", this.call_req_id));
        if (!is_empty(assgnUuid)) assgnComboNm = (string)expand(format("&{U'%s' =>combo_name}", (string)assgnUuid));
        if (ZDEBUG > 0) logf(SIGNIFICANT, "%s, assignee is %s", method, assgnComboNm);
        // Get Group last name
        grpUuid = (uuid)expand(format("&{'%s' = cr.persistent_id->group}", this.call_req_id));
        if (!is_empty(grpUuid)) grpLastNm = (string)expand(format("&{U'%s' =>last_name}", (string)grpUuid));
        if (ZDEBUG > 0) logf(SIGNIFICANT, "%s, group is %s", method, grpLastNm);
        string theMsg;
        sprintf(theMsg, "Initial assignee: %s, group: %s ",assgnComboNm, grpLastNm);
        this.description = theMsg;

    2. Restart Service Desk Manager service and create a new ticket.


    Hope that helps.



  • 7.  Re: Activity Log - Show Specific Data

    Posted Mar 26, 2019 11:23 AM



    This second one is simple and fantastic.


    I am assuming if I want the log description to say something specific (text from what it used to say (Create a new request/incident/problem/change/issue) plus this new addition (... Initial Assignee: Hainley, Katherine, Group: SSS Service Desk) I just need to change the "sprintf(theMsg," line?



    thank you


  • 8.  Re: Activity Log - Show Specific Data

    Posted Mar 26, 2019 09:16 PM

    Hi TheKatherine,

    Glad you like it :-).  That's exactly right.



  • 9.  Re: Activity Log - Show Specific Data

    Posted Mar 27, 2019 02:07 AM

    Thanks James!


    I stand in awe of the contributions on this Community.