CA Service Management

 View Only

  • 1.  Error on spel when summary or description field contains the % char

    Posted Dec 04, 2025 07:55 AM

    When a ticket (incident or Request) is saved a custom spel code is invoked, this spel goes on error when the Summary or Description field contains a % character.

     

    The % char seems to be used as a Wildcard char in the spel instead of be used a char inside the string.
    How to use this char as a string?

     

    This is the spel code invoked:
    // /////////////////////////////////////////////////////////////
    // z_copy_parentinfo
    // argv[0]: Fields number
    // argv[1]: summary     argv[2]: old value  argv[3]: new value
    // argv[4]: description   argv[5]: old value  argv[6]: new value
    // argv[7]: zchannel_cr   argv[8]: old value  argv[9]: new value
    // argv[10]: string1     argv[11]: old value  argv[12]: new value
    // argv[13]: string2     argv[14]: old value  argv[15]: new value
    // argv[16]: zsource     argv[17]: old value  argv[18]: new value
    // argv[19]: zrisk       argv[20]: old value  argv[21]: new value
    // /////////////////////////////////////////////////////////////
    void cr::z_copy_parentinfo(...) {
    string method, this_event;
    object gl, dummy_ob, to, child_domset, child_dob;
    int debug_on, child_found, child_i, flag_updated, intvuln;
    method = "cr::z_copy_parentinfo";
    debug_on = 1;
    intvuln = 400051;
    to = top_object();
      flag_updated = 0;
      this_event = event();
      send_wait(0, to, "get_co_group");
      if (msg_error()) { logf(ERROR, "%s - 010:'%s'",method, msg[0]);};
      gl = msg[0];
      if( debug_on == 1 ){
        logf( SIGNIFICANT, format("DEBUG %s(010): %s-%s",method, argv[2],argv[3]) );
        logf( SIGNIFICANT, format("DEBUG %s(020): %s-%s",method, argv[5],argv[6]) );
        logf( SIGNIFICANT, format("DEBUG %s(030): %s-%s",method, argv[8],argv[9]) );
        logf( SIGNIFICANT, format("DEBUG %s(040): %s-%s",method, argv[11],argv[12]) );
        logf( SIGNIFICANT, format("DEBUG %s(050): %s-%s",method, argv[14],argv[15]) );
        logf( SIGNIFICANT, format("DEBUG %s(060): %s-%s",method, argv[17],argv[18]) );
        logf( SIGNIFICANT, format("DEBUG %s(065): %s-%s",method, argv[20],argv[21]) );
        logf( SIGNIFICANT, format("DEBUG %s(068): %s-%s",method, argv[23],argv[24]) );
        logf( SIGNIFICANT, format("DEBUG %s(070): %s-%s",method, ref_num,persistent_id) );
      }

    Thanks



    -------------------------------------------


  • 2.  RE: Error on spel when summary or description field contains the % char

    Posted May 19, 2026 04:37 AM
    Don't ask me why, but it works well if you skip calling the `format` function, which isn't needed in `logf`.

    void cr::z_copy_parentinfo(...) {
    
    	string mth; mth = "cr::z_copy_parentinfo()";
    
    	logf(TRACE, "%s: %s --> old = %s, new = %s", mth, argv[4], argv[5], argv[6]);
    }
    regards, marc
    -------------------------------------------



  • 3.  RE: Error on spel when summary or description field contains the % char

    Posted May 20, 2026 01:23 AM
    Nice find. Thanks for care&share :)
    Best regards
    ... Michael

    Gesendet von Outlook für Android<https: aka.ms aab9ysg>
    ::DISCLAIMER::
    ________________________________
    The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.