Clarity Service Management

Expand all | Collapse all

Cancel Service Type Events on Multiple Tickets

Jump to Best Answer
  • 1.  Cancel Service Type Events on Multiple Tickets

    Posted 02-27-2019 04:30 PM

    Hi All,

     

    Is it possible to cancel Service Type Events on Multiple Tickets?

    Our customer requested a change on their Service Type, I understand that changes on Service Types will only take effect on new tickets that was created after the change is made but they want it to take effect on existing tickets before the change was made as well.

     

    This can be done on one ticket by going to the Additional Information tab > Service Type, and cancel the Attached Service Type Events there.



  • 2.  Re: Cancel Service Type Events on Multiple Tickets

    Posted 02-28-2019 01:18 AM

    How many tickets are you talking about? Sometimes it can be quicker to just manually do it, rather than look to scripting a solution.

     

    There's no out-of-the-box way to do this, and you would need to look along the lines of this thread to do something similar, I'd guess: Delete and Cancel Spel Methods on atev Object 

     

    Kyle_R.



  • 3.  Re: Cancel Service Type Events on Multiple Tickets

    Posted 02-28-2019 05:44 AM

    Hi Kyle,

     

    Around 600 at the moment.

     

    Regards,

    Ruben



  • 4.  Re: Cancel Service Type Events on Multiple Tickets

    Posted 02-28-2019 07:10 PM

    Ok, thanks Ruben.

     

    Sorry, I've got nothing more than the above - which I think is the right starting point, but needs some work to bang into shape.

    The scenario is "unusual" because normally Service Type changes are not retrospective - the new contract would apply going forward.

     

    Anyone else got some suggestions on mass update of the Service Type?

     

    Thanks, Kyle_R.



  • 5.  Re: Cancel Service Type Events on Multiple Tickets

    Posted 03-01-2019 07:55 AM

    I cannot think of any thing else other than via the backend (SQL or pdm_load). It won't be any pretty, but could do the job. (Desperate times call for desperate measures...)

     

    P.S. Make a back up the MDB before doing this



  • 6.  Re: Cancel Service Type Events on Multiple Tickets

    Posted 03-01-2019 11:28 AM

    If you are able to provide a sdm wherclause, I would be able to provide a simple spel script which does this job.
    Regards
    ....Michael



  • 7.  Re: Cancel Service Type Events on Multiple Tickets
    Best Answer

    Posted 03-01-2019 01:41 PM
      |   view attached

    Hi.

    attached is a so called fragment file , a script which can be executed by the fragment interpreter bop_cmd

    the script implements the function cancel_evt.

    It has three input parameters:

    • factory : the ticket factrory you want to work on ('cr','chg','iss' and  'wf' are supported).
    • where_clause : a so called majic where_clause, to fetch the tickets in scope.
    • doit : a flag, when set to 1 , the script will cancel all SLA events for each ticket found by the whereclause.
               if set to 0: no changes are done by the script.

    the script prints the ticket number of each ticket found which has attached SLA events.

    It also prints the current status of each event.

    ticket numbers of tickets which don't have attached SLA events are collected and skipped, but printed at the end of the script. 

     

     

    As long this script is excuted with doit=0, nothing will be changed in the system, but you will get printout of what this script finds.

     

    For example if you want to work on active incidents with with priority=3 you might execute

    bop_cmd -f cancel_evt.frg "cancel_evt('cr','type=\'I\' and active=1 and priority.sym=\'3\'',0)"

     

    The output should look similar to

    found 'cr' '110 with 3 events
    atev.id=400452 group_name=SLA Status=Fired
    atev.id=400455 group_name=SLA Status=Fired
    atev.id=400456 group_name=SLA Status=Fired
    found 'cr' '122 with 8 events
    atev.id=400654 group_name=SLA Status=Cancelled
    atev.id=400657 group_name=SLA Status=Cancelled
    atev.id=400658 group_name=SLA Status=Cancelled
    atev.id=400664 group_name=SLA Status=Fired
    atev.id=400665 group_name=SLA Status=Waiting
    atev.id=400666 group_name=SLA Status=Waiting
    atev.id=400667 group_name=SLA Status=Waiting
    atev.id=400668 group_name=SLA Status=Waiting
    Skipped Objects :28, 32, 35, 36, 38, 40, 42, 43, 44, 54, 55, 89, 92, 102, 103

    when executing the same with doit=1

    bop_cmd -f cancel_evt.frg "cancel_evt('cr','type=\'I\' and active=1 and priority.sym=\'3\'',1)"

    The output looks like

    found 'cr' '110 with 3 events
    atev.id=400452 group_name=SLA Status=Fired
    atev.id=400455 group_name=SLA Status=Fired
    atev.id=400456 group_name=SLA Status=Fired
    found 'cr' '122 with 6 events
    atev.id=400654 group_name=SLA Status=Cancelled
    atev.id=400657 group_name=SLA Status=Cancelled
    atev.id=400658 group_name=SLA Status=Cancelled
    atev.id=400664 group_name=SLA Status=Fired
    atev.id=400667 group_name=SLA Status=Cancelled
    atev.id=400668 group_name=SLA Status=Cancelled
    Skipped Objects :28, 32, 35, 36, 38, 40, 42, 43, 44, 54, 55, 89, 92, 102, 103

     

     

    For sure , you should make a backup of your DB before setting doit=1 !

     

    Hope this helps somehow. If stuff is missing or doesn't work as expected, let me know.

    Regards

    ............Michael

    Attachment(s)

    zip
    cancel_evt.frg.zip   1K 1 version


  • 8.  Re: Cancel Service Type Events on Multiple Tickets

    Posted 03-01-2019 01:47 PM

    Hi Michael,

     

    I'll test this one out on our Development. I appreciate your help.

    Thank you very much!

     

    Regards,

    Ruben



  • 9.  Re: Cancel Service Type Events on Multiple Tickets

    Posted 03-03-2019 11:42 PM

    Hi Michael,

     

    This accomplished what our customer wanted.

    Thank you very much!

     

    Regards,

    Ruben