CA Service Management

  • 1.  Attach SLA Spell

    Posted Aug 24, 2017 07:45 AM

    Hello, I am trying to bind a service type to a ticket using spell,
    However I am getting the following error message


    08/23 17: 43: 40.34 LLK85SH20073 domsrvr 2480 ERROR where.y 908 Parse error at: "461369" (syntax error)
    08/23 17: 43: 41.47 LLK85SH20073 spelsrvr 5456 ERROR sla.spl 3734 Error checking in deleted atev: Attempt to checkin with nothing checked out.


    Below the code I'm using

    uuid who;
    object newobject;
    string zattached_sla;
    send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");
    who=msg[0];

    send_wait(0, top_object(), "call_attr", "api", "get_val_for_wc", "cr", "461369","sla_violation");

    send_wait(0, top_object(), "call_attr", "api", "insert_object", who, "attached_sla", NULL, 0,
    "map_sdsc", "sdsc:400815", "ticket_id", "461369", "ticket_type", "cr", "_mapped_cr", "cr:461369","sla_viol_status",msg[0]);

     

     

    I'm using fixed values for testing before making the business rule.

     

    Thanks.



  • 2.  Re: Attach SLA Spell
    Best Answer

    Posted Aug 24, 2017 09:48 AM

    Here is example from my code

     

     

     

    //attach SLA
     send_wait(0, top_object(), "get_co_group");
      if (msg_error()) {
        logf(ERROR, "Error getting group_leader: '%s'", msg[0]);
        return;
       }
      else{
        group_leader = msg[0];
        send_wait(0, top_object(), "call_attr", "attached_sla", "add_ast", wf_persid, wf_template.zservice_type.id, group_leader, "SLA", 2, 0); 
         if (msg_error()) { 
          logf(ERROR, "Error calling function add_ast: %s",msg[0]); 
          send_wait(0, group_leader, "uncheck");
           if (msg_error()) {
            logf(ERROR, "Error in uncheck: '%s'", msg[0]);
           }
          return;
         } 
         send_wait(0, group_leader, "checkin");
         if (msg_error()) {
          logf(ERROR, "Error Attaching SLA on checkin: '%s'", msg[0]);
          send_wait(0, group_leader, "uncheck");
           if (msg_error()) {
            logf(ERROR, "Error in uncheck: '%s'", msg[0]);
           }
          return;
         }



  • 3.  Re: Attach SLA Spell

    Posted Aug 24, 2017 10:13 AM

    Sorry the question but the variables
    Wf_persid and wf_template.zservice_type.id
    Would be the persid of the SLA and Id of the SLA?
    Example:
    Wf_persid: sdsc: 400814
    Wf_template.zservice_type.id: 400814

     

    thanks



  • 4.  Re: Attach SLA Spell

    Posted Aug 25, 2017 03:37 AM

    Wf_persid - workflow task persid since this example from change workflow

    Wf_template.zservice_type.id - service type id