CA Service Management

  • 1.  How to attach an incident (inactive) to a problem (active)

    Posted May 07, 2019 04:43 PM

    Hello everyone.

    I need help about this…

     

    We need to active an incident (being inactive because is closed or cancelled) just before attaching it to a problem (active), and then inactive the incident.

     

    Is it possible to modify any OOTB component (.spl, .js, .maj, etc) to active an incident automatically and then inactive it after attaching it to a problem? All this in the “Aceptar/Ok” button:

    We have installed the option: edit_inactive and we can’t uninstall it because of bussiness rules of our customer.

     

    We have found in cm.maj there is the function “pre_val_update_cr” (but I can’t find where the definition is) which evaluate the"active" attribute in the incident and the manager option edit_inactive:

     

    Thanks in advance!

     

    Ana K.



  • 2.  Re: How to attach an incident (inactive) to a problem (active)

    Posted May 09, 2019 08:36 AM

    Hi Ana,

     

    Here's my 2-cents...you are going to have to write your own custom spel-code trigger to override the OOTB functionality.

     

    ===

    Kind Regards,

    Brian



  • 3.  Re: How to attach an incident (inactive) to a problem (active)

    Posted May 10, 2019 02:42 AM

    Hello Ana,

     

    >> We need to active an incident (being inactive because is closed or cancelled) just before attaching it to a problem (active), and then inactive the incident.

     

    Note that this is going to alter the Incident "Last Modified" date/time. This might become important later for reporting.

     

    Kyle_R.



  • 4.  Re: How to attach an incident (inactive) to a problem (active)

    Posted May 16, 2019 10:10 PM

    Can you provide some detail as to why you need to do this to the ticket (make it active and then inactive again)?  What is the restriction that you are trying to get around, or the business outcome that you currently can't achieve?

    Regards,

    James



  • 5.  Re: How to attach an incident (inactive) to a problem (active)
    Best Answer

    Posted May 17, 2019 03:17 AM

    Hi Ana K.

    you might give the following a try:

    copy the code to a file with extension .spl in your site/mods/majic directory and restart your sdm service.

    Be aware that this code is provided as is, and it overrides the standard behavior! Meaning, you own the code and you are responsible for this.

    I adopt the mimic of the standard behavior, but omit the inactive check, when the problem attribute gets set from empty to anything.

    That means if someone set the problem attribute , he would also be able to change other attributes of the inactive incident as well.

     

     

    int cr::pre_val_update_cr( ... )
    {
       string method;
       string ticket_type;
       string env;

       method = "cr::pre_val_update_cr";

       send_wait(0, this, "call_attr", "type", "get_val");
       if (!(msg_error())) {

          if (!(is_null(msg[0]))) {
             ticket_type = msg[0];
          }
       }
       else {
          logf(ERROR, format("Error getting type - (%s)", msg[0]));
          return;
       }

       if (!(argv[2]) && !(argv[3])) {
          env = getenv("NX_EDIT_INACTIVE");
          send_wait(0, this, "call_attr", "problem", "get_orig_val");
          if(is_null(problem) || !is_null(msg[0])) {
             if (!(is_empty(env)) && downcase(env) == "no") {
                set_error(1);
                if (ticket_type == "P") {
                   set_return_data(find_msg(5, 281));
                }
                else if (ticket_type == "I") {
                   set_return_data(find_msg(5, 282));
                }
                else {
                   set_return_data(find_msg(5, 229));
                }
             }
          }
       }
    }

    Let me know, if this solves your question

    Regards

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



  • 6.  Re: How to attach an incident (inactive) to a problem (active)

    Broadcom Employee
    Posted May 21, 2019 08:08 AM

    https://communities.ca.com/people/ANA_KBS

     

    Did MichaelMueller  SPEL code provide the desired results?