CA Service Management

  • 1.  Error checking in deleted atev: Attempt to checkin with nothing checked out.

    Posted Mar 15, 2018 12:35 PM

    Hi Team,
    my requirement is to set the service type of an incident depending on the CIof the incident.
    I defined a local attribute zServiceType for the nr object. When an incident is create and a CI was selected
    a spel method is triggered, to attach the service type of the CI and the events to the new incident.
    The Spel Method works fine, but a method in sla.spl fails with the following error message:

    03/15 17:06:50.21 WIN-3HUAE9PVA1 spelsrvr             5296 ERROR        sla.spl               3734 Error checking in deleted atev: Attempt to checkin with nothing checked out.

     

    I have no idea what's the reason for this behavior and how to solve the problem.

    Do you perhaps know a solution?


    Regards   Baerbel

     

     

    The Spel Method looks like this:

    cr::z_set_sla (...)
    {
    object group_leader, obj, nr_obj;
    string method, affected_ci_id, nr_service_type, affected_ci_pid, incident_pid;
    int  i, x, y, servicetype_id; 
    method = "z_set_sla";

    for(i=0;i<argc;i++)  logf(ERROR,"** %s argv[%d]=%s", method, i, (string)argv[i]);

    affected_ci_id    = argv[6];
    incident_pid = argv[2];

     if ( (string)argv[5] != (string)argv[6] && !is_null ((string)argv[6]) ) {
          //  logf(ERROR,"* ok *");
       
     x = sindex(affected_ci_id, "[^ ]");
     affected_ci_id = substr(affected_ci_id, x, strlen(affected_ci_id));
     x = sindex(affected_ci_id, "[ ]*$");
     affected_ci_id = substr(affected_ci_id, 0, x);
     affected_ci_pid = format ("nr:%s", affected_ci_id);
     nr_service_type = (string) expand(format("&{'%s' = nr.persistent_id-> zServiceType}", affected_ci_pid));
     //logf(ERROR,"nr Service Type , %s", nr_service_type);
     y = sindex (nr_service_type, ":");
     //logf(ERROR,"y , %d", y);
     servicetype_id = (int)substr(nr_service_type, y+1);
     //logf(ERROR,"Service Type ID , %s", servicetype_id);

     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", incident_pid, servicetype_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;
      }
     
     }
    }
    }



  • 2.  Re: Error checking in deleted atev: Attempt to checkin with nothing checked out.
    Best Answer

    Posted Mar 15, 2018 09:57 PM

    Why can't you attach the service type to the CI and let the out-of-the-box functionality attach it to the ticket?  Is it because you don't want the service type to attach to every ticket referencing the CI, or something like that?  Sorry that doesn't help with your specific issue, but I'm curious.

     

    Regards,

    James



  • 3.  Re: Error checking in deleted atev: Attempt to checkin with nothing checked out.

    Posted Mar 16, 2018 01:52 AM

    try to add logf before calling add_ast to validate that incident_pid, servicetype_id have correct values.

     

    Regards,

    Timur Alimov



  • 4.  Re: Error checking in deleted atev: Attempt to checkin with nothing checked out.

    Posted Mar 19, 2018 10:05 AM

    Hi James, Timur,

    my requirement is to set the service type only when the incident is created and a CI is selected.
    I defined a Trigger with this condition and the spel-code that causes problems. Now I could agree with the customer to select a CI only when the Incident is created, otherwise it will be readonly. Now out of the box service type and the events are attached. Anyway, in my WMWare I inserted the logf to see if the id's are OK. They are correct, but I get the error message. So the customer is happy, but my problem still exists. If you have an idea for a solution you are welcome.

    Thanks
       Baerbel