CA Service Management

  • 1.  Activity Notification Events for closed tickets

    Posted Aug 27, 2015 10:18 AM

    We are trying to automate the re-opening of closed tickets when new comments are logged.


    However for the Log Comment Activity Notification, Events do not appear to be firing for closed tickets. If I manually re-open the ticket the Event fires correctly. The associated Notification Rules do fire when closed, but not the Events.

     

    Any ideas or suggestions to help work around this?



  • 2.  Re: Activity Notification Events for closed tickets

    Posted Aug 27, 2015 10:35 AM

    Hi,

    this can be done via SPEL but I'm not sure that opening closed tickets is a good idea.

    My suggestion is to open a new one if previous ticket was closed.

     

    But if you want :)

     

    code:

    mod file:

         MODIFY alg POST_VALIDATE open_on_comment() 14438 FILTER(EVENT("INSERT") && type=="LOG");

     

    spl file:

         alg::open_on_comment(...){

              macro::upd_val("cr", format("id=%d", call_req_id.id ), 3, 15, "status", "OP");

         }

    upd_val macro is from this thread:SPEL: Object update

     

    Regards,

    cdtj



  • 3.  Re: Activity Notification Events for closed tickets

    Posted Aug 27, 2015 11:05 AM

    Thanks for the great information!  I'lll give it a shot.

     

    We also want to limit by request category, but that part was working correctly in the site-defined condition so I didn't mention it. Could category be added to the filter? Is this syntax for this documented anywhere? What is the 14438?

     

    I could probably steer them towards opening a child ticket via IT PAM automation, but that has the same issue of getting the Event to trigger.

     

    In the larger context this is for tickets opened via customer email, being worked and closed, but then the customer providing an update via email that logs a new comment to the closed ticket.



  • 4.  Re: Activity Notification Events for closed tickets

    Posted Aug 28, 2015 01:40 AM

    Hi Kris,

     

    I'll recommend to start from this doc : Where can I find Spel functions documentation? by TMACUL.

    Category could be filtered within spl file, constraint will look like:

    if ( (call_req_id.category.id != 400001) && (call_req_id.category.id != 400002) ) { // if you have only few categories you can exclude them by id
        <...>
    } else if (sindex(call_req_id.category.sym,"Hardware.") == -1) { // or exlucde categories by mask "Hardware."
        <...>
    }
    
    

    14438 is a random number that should be unique for each function.

    You can get and use creation type from call_req_id.created_via to prevent affection on other tickets.

     

    Regards



  • 5.  Re: Activity Notification Events for closed tickets

    Posted Aug 28, 2015 04:40 AM

    The '14438' is an indicator of the sequence in which this function is run compared with any others registered for the POST_VALIDATE event. Normally you make it very large to ensure (hopefully) that your user-defined actions happen after any system actions.  If you have multiple actions against the same event give your numbers an appropriate sequence - and obviously don't make them all the same :-).



  • 6.  Re: Activity Notification Events for closed tickets

    Posted Sep 08, 2015 02:23 PM

    We attempted to implement this on our development environment but it proved unstable timing out when trying to complete so it was removed. Ultimately we decided to not to reopen this ticket but send targeted email notifications when comments were added to closed tickets.

     

    Thanks for the suggestions!



  • 7.  Re: Activity Notification Events for closed tickets

     
    Posted Sep 01, 2015 07:29 PM

    Hi Kris - Did the ideas provided get you a resolution? If so please mark the appropriate as Correct Answer. Thanks! Chris