CA Service Management

Expand all | Collapse all

Cancel Attached Type Service on Incidents/Requests

  • 1.  Cancel Attached Type Service on Incidents/Requests

    Posted 07-23-2015 11:02 AM

    Hello guys,

     

    Is possible cancel a type of service attached to a ticket ?
    I want to attach a new type of service , but I wish the previous type of service already attached is canceled .

    It's possible?



  • 2.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 07-23-2015 12:17 PM

    Hi Thiago.

     

    Yes, is possible.

     

    Follow this steps:

    1. Open the ticket do you want to cancel.

    2. 1. additional information

    3. 2. type of service

    4. Cancel

    Evi.jpg

     

    Is that do you want to know?



  • 3.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 07-23-2015 12:57 PM

    Sorry,

     

    I need this action to occur automatically and no manual.

    I don´t want to click Cancel Action, I need this automatically.



  • 4.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 07-23-2015 05:32 PM

    Hi Tiago,

     

    Can you tell me how your type of service is, and how you want it ?

    You can have many types of services, depending on how your ServiceDesk works , you can enter an event or a macro in specific.



  • 5.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 07-24-2015 02:55 AM

    Hi,

    you can use this code:

    string wc;
    int i, atev_count;
    object gl, atev_list, atev_dob;
    wc = format("obj_id = 'cr:%s' AND group_name = 'SLA'", id); // CHECK CORRECT WHERE_CLAUSE HERE
    send_wait(0, top_object(), "call_attr", "atev", "sync_fetch", "STATIC", wc, -1, 0);
    atev_list = msg[0];
    atev_count = msg[1];
    
    if (atev_count > 0)
    {
      for (i=0;i<atev_count;i++) {
           send_wait(0, top_object(), "get_co_group");
           if (msg_error()) {
                logf(ERROR, "Error : %s", msg[0]);
                return;
           }
           gl = msg[0];
    
           send_wait(0, atev_list, "dob_by_index", "DEFAULT", i, i);
           if (msg_error()) {
                logf(ERROR, "Error : %s", msg[0]);
                return;
           }
           atev_dob = msg[0];
    
           send_wait(0, gl, "checkout", atev_dob);
           if (msg_error()) {
                logf(ERROR, "Error : %s", msg[0]);
                return;
           }
           send_wait(0, atev_dob, "cancel_me");
           if (msg_error()) {
                logf(ERROR, "Error : %s", msg[0]);
                return;
           }
           send_wait(0, gl, "checkin");
           if (msg_error()) {
                logf(ERROR, "Error : %s", msg[0]);
                send_wait(0, gl, "uncheck");
                return;
           } else {
                logf(SIGNIFICANT, "successfully cancelled event for chg:%d", id);
           }
      }
    }
    
    

     

    regards,

    cdtj



  • 6.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 07-24-2015 10:48 AM

    Thanks for sharing this cdtj.



  • 7.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 11-26-2015 02:31 PM

    Hello.

     

    Somebody knows if there is a code to cancel events for Worflow (WF)? All Spell Code that we found works only for CHG, CR and ISS.

     

    Our problem:

     

    We need to cancel a single repeated event. We use an event that verify a condition on a task. When the condition is reached, the event calls 3 action macros. The last one must cancel the original Event.

     

    For internal reasons we dont want use CA PAM.

     

    We observed the function update_object_super only works with chg, cr and iss objects.

     

    Thanks for help.



  • 8.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 11-27-2015 01:24 AM

    hi,

    code described 2 post upper is using "cancel_me" method and works for any kind of attached avents.

     

    You can create spl file in your mods/majic directory, then place this code into it:

    int atev::z_cnclme_by_persid(string atev_persid) {
        object gl, atev;
        send_wait(0, top_object(), "call_attr", "atev", "dob_by_persid", 0, atev_persid);
        if (msg_error()) {
            logf(SIGNIFICANT, "Error : %s", msg[0]);
            return 0;
        }
        atev = msg[0];
        send_wait(0, top_object(), "get_co_group");
        if (msg_error()) {
            logf(SIGNIFICANT, "Error : %s", msg[0]);
            return 0;
        }
        gl = msg[0];
        send_wait(0, gl, "checkout", atev);
        if (msg_error()) {
            logf(SIGNIFICANT, "Error : %s", msg[0]);
            return 0;
        }
        send_wait(0, atev, "cancel_me");
        if (msg_error()) {
            logf(SIGNIFICANT, "Error : %s", msg[0]);
            return 0;
        }
        send_wait(0, gl, "checkin");
        if (msg_error()) {
            logf(SIGNIFICANT, "Error : %s", msg[0]);
            send_wait(0, gl, "uncheck");
            return 0;
        } else {
            // logf(SIGNIFICANT, "[%s] canceled", atev.persistent_id);
            return 1;
        }
    }
    

    this function will cancel event by its persid,

     

    then add to your Action Macro this code:

    if (atev::z_cnclme_by_persid(attached_event.persistent_id)) {
         logf(SIGNIFICANT, "[%s] canceled successfuly for [%s].", attached_event.persistent_id, persistent_id);
    } else {
         logf(SIGNIFICANT, "[%s] for [%s] cannot be canceled.", attached_event.persistent_id, persistent_id);
    }
    

     

    this code is valid for every Action Macro that executes by Attached Events.

    More information about attached events could be found in this doc : SPEL EVENT methods

     

    Regards,

    cdtj



  • 9.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 11-27-2015 05:08 AM

    checked this in my test env,

    to cancel current event you can simply create Action Macro with followed code:

    send_wait(0, attached_event, "cancel_me");



  • 10.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 11-27-2015 03:29 PM

    Sensational! It works.

    We used the last code ["send_wait(0, attached_event, "cancel_me");"]. We understood also the first code, but the last one is more simple.

     

    Thank you very much cdtj.



  • 11.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 12-08-2015 06:48 PM

    Hi, I 'm trying to use this line  [send_wait(0, attached_event, "cancel_me");] in a action in a macro . My idea is... when a category is changed, whatever the service type associated,all the attached events of the old category  must be canceled or deleted , and show only the attached events of the new category. but does not work for me .

     

    configuration:

    category aplications -> service type 1hh

    category email         -> service type 1hh

     

    activity notification "field update" -> events -> actions on true= action macro  -> send_wait(0, attached_event, "cancel_me");

     

    please your help

     



  • 12.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 12-09-2015 04:47 AM

    hi,

    this should be done in 2 steps:

    - fetch all attached events you decided to cancel;

    - pass it through function described before: atev::z_cnclme_by_persid(string atev_persid).

     

    code will look like:

    int zcount, i;

    object zfound, zobj;

    send_wait(0, top_object(), "call_attr", "atev", "sync_fetch", "STATIC", format("group_name = 'SLA' AND status_flag IN (2, 12) AND obj_id = '%s'", persistent_id), -1, 0);       

    zcount = msg[1];

    if (zcount > 0) {

        zfound = msg[0];

        for(i = 0; i < zcount; i++) {

            send_wait(0, zfound, "dob_by_index", "DEFAULT", i, i);

            zobj = msg[0];

            atev::z_cnclme_by_persid(zobj.persistent_id);

        }

    }



  • 13.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 07-24-2015 08:25 AM

    The type service controls the SLA of the groups, and what I want to do is whenever a call is transferred to another team, the type of service that is already bound to the call is canceled.



  • 14.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 07-24-2015 06:40 AM

    Hi thiago

    You can create a macro on servicedesk, add events and conditions on the macro,
    the marco must kick off an ITPAM process that will cancel the attached events on your service type and add new events.

    To cancel and add events on the attached service type use web services (createObject to add events and updateObject to cancel events)

     

    I hope this helps



  • 15.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 07-24-2015 08:23 AM

    Hi Sivuyile,

     

    I don´t have ITPAM on my infrastructure, not yet.



  • 16.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 06-20-2017 09:52 AM

    hi everyone

     

    any method for cancelling event with web service?

    I tried to update status_flag field to "0" but it doesn't work I think



  • 17.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 06-20-2017 09:58 AM

    Hi Utku!

    you can use the function from this comment: https://communities.ca.com/thread/241735782#comment-241843885 

    Then register it as a method and call from webservice: SPEL: How to call SDM method using WebServies 

    Regards,

    cdtj



  • 18.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 06-20-2017 10:23 AM

    Hi cdtj

     

    I was just looking for a workaround solution. I don't need it permanently but there is a problem with one of the tickets and I want to cancel its events. Since I have a display issue with the ticket, I asked for any update method via web service for cancellation



  • 19.  Re: Cancel Attached Type Service on Incidents/Requests

    Posted 06-20-2017 11:24 AM

    Mentioned workaround gives possibility to call any method from WebServices.

    I'm suggesting it because I think there is no out-of-the-box methods to manage events...