CA Service Management

 View Only
  • 1.  Add activity log to ticket with custom activity attribute

    Posted Jan 10, 2018 11:07 AM

    We're using macro action "Add activity log - SLA Expired" attached to Service Type event to add an activity log when Ticket's service type is affected. This Macro use  a Spel Function find_msg(63, 13, event_tmpl.sym, event_tmpl.condition.sym); This function register an activity to ticket with details in Activity User Description field. Now, there is a requirement in order to update other Activity attribute for example "Internal", or any custom activity attribute. How could we achieve this?

    Thanks for your help.

    Regards,

    JOHN



  • 2.  Re: Add activity log to ticket with custom activity attribute

    Posted Jan 10, 2018 11:46 AM

    Hey John, 

     

    If you are looking to update the activity log when there is activity with a custom field/attribute, then this should help you:

     

    How to generate an Activity Log when a custom field is updated. 

     

    Please let us know if this is not what you are looking to do, along with some more details if possible.

     

    Thanks!

    Brandon Persad



  • 3.  Re: Add activity log to ticket with custom activity attribute

    Posted Jan 10, 2018 12:10 PM

    Brandon, thanks for your comment.

     

    Our requirement is different from activity log for custom field because this custom field is for an object like CR, IN, PR or others like this. But, what we have here is a custom attribute for activity (alg) object per se. You could try this (in concept) like an effort to capture some details at activity time. Ex: what analyst is the ticket assignee when a Service Type was violated (this type of data that in ticket lifetime is variable) and we try to capture this in the Service Type violation event, but, using the referred function we could only modify the user description field.

     

    Not sure if this clarify our use case. Hope so...

     

    Best Regards.



  • 4.  Re: Add activity log to ticket with custom activity attribute
    Best Answer

    Posted Jan 12, 2018 02:59 AM

    Hi Johnv,

     

    the macro 'Add Activity Log - SLA expired' calls the function 'log_event' to create the activity log record, but that function obviously does not have an option to flag the log entry as internal.  You could use function 'generic_activity_log' instead:generic_activity_log - which has as its last argument the option to set the 'internal' flag.  However, neither of those functions allows you to update a custom field on the activity log record.

     

    For your specific example, to capture the analyst when a violation is recorded - in a custom field 'zAnalyst' perhaps - I would be inclined to add a trigger.  Something like this ought to do it.  This will capture the 'zAnalyst' field for every EVT activity log created, which may be excessive.  You might want to test in the function whether the activity log description starts with "AHD63013", and only update 'zAnalyst' if that is so.

     

    I haven't tested this function myself, so be prepared to do some debugging.

     

    zAlg_triggers.mod:

    MODIFY alg POST_VALIDATE zCaptureAnalyst() 9999 FILTER( type == "EVT" ) ;

     

    zCaptureAnalyst.spl:

    alg::zCaptureAnalyst(...)
    {
    string method;
    method = "alg::zCaptureAnalyst";
    logf(SIGNIFICANT, "%s, started", method);
    uuid curr_zAnalyst;
    curr_zAnalyst = this.zAnalyst;
    if (is_empty(curr_zAnalyst))
    {
       // No assignee recorded yet in the activity log.  Capture it from the ticket.
       uuid theAnalyst;
      // Look up the assignee for the ticket to which the activity log belongs.
       theAnalyst = (uuid)expand(format("&{'%s' = cr.persid->assignee}", this.call_req_id));
       this.zAnalyst = theAnalyst;
       logf(SIGNIFICANT, "%s, updated zAnalyst", method);
    }
    logf(SIGNIFICANT, "%s, finished", method);
    }

    Let me know how it goes if you decide to take this approach.

    Regards,

    James



  • 5.  Re: Add activity log to ticket with custom activity attribute

    Posted Jan 12, 2018 04:14 AM

    my 2 cents:

    actually find_msg function fetches message from msg_catalog/pdm.xml, where 63 and 13 are message set and message index:

    <msg id="63013"><text product_id="default">sla expired.&#13;event &apos;%1&apos; triggered by condition &apos;%2&apos;.</text></msg>

    other arguments are used to replace %<num> with themselves as values.

     

    Regards,

    cdtj