CA Service Management

 View Only
Expand all | Collapse all

SDM - Take action if Log Comment is 'Created By' Customer

  • 1.  SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 14, 2016 03:40 PM

    SDM 14.1.02

     

    Use Case:

     

    Analysts request additional information from affected end users  / customers.  They change Status to 'Awaiting End User Response' which places the ticket on Hold and they send a notification to the customer.

     

    We have inbound email setup for Update on reply to notifications.

     

    Customer either replies to the email OR selects the ticket from their queue in the SDM employee/customer self-service interface (NOT USS) and uses the .Add Comment button.

     

    We need to capture the Activity Log 'Created By' (alg.analyst) and compare it to the ticket customer.  If they are the same and the status is 'Awaiting End User Response', then set the status to something else ('Customer Replied' for example); which takes the ticket out of hold and other notifications as needed.

     

    We have already changed the 'Updated via EMAIL interface.' activity comment to type 'Custom Log Comment', so I thought I could at least create a condition check for activity log type 'Custom Log Comment'' however this doesn't do anything for the other optional response using the web interface.

     

    Is there a way to do this using existing macros and conditions or am I looking at a custom Spel?

     

    Thanks,

     

    J.W.



  • 2.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 14, 2016 03:58 PM

    Hi Jeff - to do this type of comparison you would need custom spel code.  There may be other customers out there who have accomplished this and may be willing to share their info with you. 

    Sorry I cant offer you much from a Support standpoint on this one.

    Thanks,

    Jon I.



  • 3.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 14, 2016 04:35 PM

    Thanks, Jon.  I didn't expect this to be a product issue so thanks for the look in.  Always appreciated!

     

    J.W.



  • 4.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 14, 2016 04:21 PM

    Hi, SD14 allows to attach event to activity notification, so you can use log comment activity notification and configure event there.

    Event should check if log_agent = customer, and if it is true shoud execute action macro. There is some allredy predefined action macros for status change

    If you need custom one you need to create new based on existing one, all you need to do is to change status code

    You will not be able to create action macro without interface modification, but you can use pdm_extract to extract existing one, make neccessary modifictions (change macro code and symbol) and load it using pdm_load (not pdm_userload since this command will not generate new id and persistent_id for macro). Do not update existing one because most probably it will be overwriten by next patch.



  • 5.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 14, 2016 04:50 PM

    Thanks, Gutis.

     

    I will look at the attaching Event to the Notification.  However, I am not looking for the log_agent ('Reported By' on the CR) but the alg.analyst ("Created By' in the Activity Log).  I have already checked for Object Attributes of alg in  Activity Association Type but it does not appear it can be extended via dotted notation to alg.analyst (unless, of course, I missed something).

     

    I am looking at something similar to this:

     

    // continue only if the call request/incident/problem is active and the activity log analyst is the same as the RIP customer

    //

    if (active == 0) {

    set_return_data(FALSE);

    return;

    }

     

    // False if there no activity logs for this request; may not be needed if follow comparison works

    if (is_null(alg.call_req_id)) {

    set_return_data(FALSE); 

    return;

    }

     

    if (alg.analyst != cr.customer)) {

    set_return_data(FALSE);

    return;

    }

     

    set_return_data(TRUE);

     

    J.W.



  • 6.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 14, 2016 04:56 PM

    log_agent always contains alg.analyst information of the last activity log. So simply it will contain id of the user that performed last activity.



  • 7.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 14, 2016 04:59 PM

    Sorry not the last activity, but who created las activity log. You can use this attribute in different situations e.g. when you don't wan't to notify assigne on log comment if he is the one who commented



  • 8.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 15, 2016 10:53 AM

    I have tried to set this up to compare log_agent to customer.  (NOTE:  I had to create 'Reported By' as it did not exist OOTB).

     

     

    This is the result:

     

    If a customer creates a ticket they are both the Reported By and the Affected End User on the Request by default unless changed.

    Setting the Event on Log Comment to check if they are the same will fire _every_ time, regardless of who logged the comment, because they have not changed on the ticket..  This is not what is needed as this would change the status every time an activity is logged.

     

    If someone other than the customer creates a ticket then the Reported By and the Affected End User will be different by default unless changed.

    Setting the Event on Log Comment to check if they are the same _will never fire_, regardless of who logged the comment, because they have not changed on the ticket..  This is not what is needed as the status would never change when the customer logs a comment.

     

    What we need is that. regardless of the Reported By person, the action is taken only when the customer is the one who is logging the comment.

     

    Trying to change this from a Site Conditional to a Conditional and then manually changing the condition to use alg.analyst like so:

     

     

    Results in these errors when evaluated on a new Log Comment:

     

    01/15 10:40:01.74 WIN-SDM domsrvr         2900 ERROR   domset.c       12689 Unable to forward the message to attribute analyst
    01/15 10:40:01.74 WIN-SDM spelsrvr       3352 ERROR   pcexec.c         6403 Spell interp failed at Activity Log by Customer:2:: get_attr on alg.analyst failed: Unknown name. analyst
    01/15 10:40:01.74 WIN-SDM spelsrvr       3352 ERROR   macro.spl         538 Unknown name.
    01/15 10:40:01.74 WIN-SDM spelsrvr       3352 ERROR   macro.spl         538 analyst
    01/15 10:40:01.74 WIN-SDM animator_nxd   2284 ERROR   animator_nxd.c   2733 Unknown name. in Attached_Event in method evaluated_condition

     

     

    Which I think is to be expected.

     

    Trying to decide which approach to take next.

     

    thanks,

     

    J.W.



  • 9.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 15, 2016 03:26 PM

    Oh sorry i messed up the atributes it is audit_userid you can also use last_mod_by

    e.g. audit_userid == customer or last_mod_by == customer



  • 10.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 15, 2016 03:30 PM

    Ok i tested and the following condition macro gives expected results

     

    logf(ERROR,"%s",last_mod_by.userid);
    if (customer == last_mod_by)
    {
    set_return_data(FALSE);
    logf(ERROR,"FALSE");
    }else
    {
    set_return_data(TRUE);

    logf(ERROR,"TRUE");
    }

     

    Sorry for confusing you



  • 11.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 15, 2016 03:35 PM

    You may also check user interface type in condition macro to ensure that action was done from the right interface. e.g

    cnt::get_login_user_interface_type() == 1

    means that action was performed from end users interface



  • 12.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 18, 2016 10:27 AM

    Unfortunately, this also does not work.  Coded as:

     

     

    Still results in the condition firing even when the analyst logs a comment instead of the customer.

     

     

    The analyst is 'ServiceDesk' and the customer is 'Employee, Test'.

    Note:  I have a one minute delay on the Event.  Old habit.

     

    thanks,

     

    J.W.



  • 13.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 18, 2016 10:42 AM

    Found it!

     

    The condition check had to be reversed. If the customer is NOT the last modified by, then set the condition to false, else set to true.

     

    logf(ERROR,"%s",last_mod_by.userid);

    if (customer != last_mod_by)

    {

    set_return_data(FALSE);

    logf(ERROR,"FALSE");

    }else

    {

    set_return_data(TRUE);

    logf(ERROR,"TRUE");
    }

     

     

    Thanks, Gutis!

     

    J.W.



  • 14.  Re: SDM - Take action if Log Comment is 'Created By' Customer
    Best Answer

    Posted Jan 18, 2016 11:29 AM

    As it turns out, since the condition uses two existing attributes, we can now create a standard Site-Defined Condition Macro and this works as well with having a customized Condition Macro.  However, we first have to create a new Activity Association since Last Mod By does not exist OOTB,

     

    (new) Activity Association

     

     

    (new) Site-Defined Condition Macro:

     

    (new) Update Status on Customer Log Comment Event

    - Configuration

    -Action Information

    Add this event to the 'Log Comment' Notification Activiry

     

     

    Thanks, Gutis.  We had to go the long way around.  Thanks for the walk-through.

     

    J.W.



  • 15.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 18, 2016 12:50 PM

    You're welcome

     

    Sent from my iPhone



  • 16.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 21, 2016 06:13 AM

    Log Activities are also generated by various errors. Just opened an issue for support.

    For example,  set up notification via  for status RE and customer does not have  email address set.

    That causes Log Comment. So if if have your own triggers or events associated for LOG they get misfired.

    Also when receiving email (response to your previous inquiry) you may get double Log Comments (See TEC556417).

    Would like to have just another type than LOG for automatically generated (hardcoded) activities.

    (ERROR, WARNING, INFO,... or similar).

    Hannu



  • 17.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 21, 2016 07:21 AM

    This is how we do this:

     

    the email reply from the customer will update the ticket AND change the status to a new status (e.g. "customer provided feedback").

     

    From there you can set up further logic / notifications etc.

     

    That's all there is to it.



  • 18.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 21, 2016 07:42 AM

    Just like I did it also. Status change is triggred by Log Comment because also when analyst or customer adds comment via GUI we need  status change. The problem is that you get two Log Comments when receive email (unless modified according TECHDOC).

    Now it has been found that in various errors CA has decided to use same  LOG type for various errors generating more Log comments.

    So, when having event associated LOG, it will fire up  cases where it was not designed to do so.  I do not know when those addtional messages has been added (i.e. since what version)? I know we did not have problems with  ver. 6...12.6.

    We got issue when you change status into RE => that fires notification to customer, but customer doesnt have email address => get additional Log comment => LOG fires up status change and we are back "customer provided feedback" status. Never get this ticket done...



  • 19.  Re: SDM - Take action if Log Comment is 'Created By' Customer

    Posted Jan 22, 2016 08:49 AM

    You are right.  I had already changed the Activity Type for this to 'Custom Log Comment'.

     

    CA should update these System generate messages so they do not have the same Activity Type as routine Log Comment.  Besides this use case, they force report writers to look at other attributes such as the System / User Description fields - and parsing text is always a horrible idea in reporting.

     

    J.W.