CA Service Management

 View Only
  • 1.  variables do not respond

    Posted Feb 12, 2016 12:22 PM

    Hi everyone,

    I have been working with CA SDM version 12.6, and we need to upgrade our tickets by email.

    some of our fields are custom "z". and they are of type dropdown.

    attached image

     

    but when sending mail these variables does not respond.

    these are the variables that have carried out the tests:

     

    *  INCIDENT.ZWORKSPACESOLUTION_PERSID=zWorkspaceSolution.INTEGER.lookup_zWorkspaceSolution_by_persid

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

    *  INCIDENT.ZWORKSPACESOLUTION=zWorkspaceSolution.STRING

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

    *  INCIDENT.ZWORKSPACESOLUTION_PERSID=zWorkspaceSolution.INTEGER.lookup_urgency_by_persid

     

    the following variables, which are sent in the mail.

    %INCIDENT_ID= GTR-207862

    %STATUS= En Proceso

    %zWorkspaceSolution= COMUNICACIONES.INSTALACIONES.FALLA DE ENERGÍA ELÉCTRICA



  • 2.  Re: variables do not respond

    Broadcom Employee
    Posted Feb 12, 2016 01:01 PM

    Firstly, you need to determine (if you don't know already) what the field type i"zWorkspaceSolution" is.

     

    Launch Web Screen Painter, and go into the schema designer.

    Go into the "cr" Table, and find "ZWorkspaceSolution" (make sure you have the correct case of each letter).

    I'm assuming the "Field Type" should be "SREL" here, note the "SREL Table"

    In Schema Designer go to the "SREL Table" noted above and click the table name, there should be a "Foreign Key Field", note what this is. Expand the table's folder, and find the Field noted as the Foreign Key Field, select it and note that "Field Type".

     

    Let's assume that the field is an Integer (which I'd say is the most likely case, but I can't know for certain without looking at your customization), you will want to add this into the text_api file:

     

    INCIDENT.ZWORKSPACESOLUTION=zWorkspaceSolution.INTEGER

     

    (once again, the case is sensitive of the second "zWorkspaceSolution")

     

    Then when you pass the value in the email you want want to specify it as:

     

    %ZWORKSPACESOLUTION=*integer value*

     

    The integer value will NOT be the actual name of the item, for example: "COMUNICACIONES.INSTALACIONES.FALLA DE ENERGÍA ELÉCTRICA", the integer is the numeral id associated to that solution. You will need to obtain the correlating id by reviewing the table where the Workspace Solutions are stored.

     

    NOTE:

    It may be possible to introduce additional customization so that you will be able to put the name value, but from previous experience I've seen that spel code was required. If anybody else has any ideas please let us know.



  • 3.  Re: variables do not respond

    Posted Feb 12, 2016 01:54 PM

    Hi ALEXANDER PERRETTI,

     

    exactly my field you want to update is a SREL field.

     

    and table pointed to by the same name.

     

    I understand that enter the string value ... would have to send the variable "integer" the ID of my field.

     

    example:

    % ZWorkspaceSolution = 10101010101010101

     

    * INCIDENT.ZWORKSPACESOLUTION_PERSID = zWorkspaceSolution.INTEGER.lookup_zWorkspaceSolution_by_persid

     

    and I want to send the value as follows:

    % = COMUNICACIONES.INSTALACIONES.FALLA zWorkspaceSolution ELECTRICITY

     

    I can help with the correct syntax to add to text_api file.

     

     

    Regards,

    Marco Velazquez.



  • 4.  Re: variables do not respond

    Broadcom Employee
    Posted Feb 12, 2016 03:12 PM

    Marco,

     

    As I mentioned if you follow my steps you should be able to update the value using the numeral id value associated to the Solution. If you would like to input the exact name additional customization is needed. Maileater is isn't going to perform a lookup for the name based on the id, so additional code aside from just the text api update is required.



  • 5.  Re: variables do not respond

    Posted Feb 13, 2016 02:07 PM

    In addition to the comments that Alexander mentions, you must also remove the space between the '=' and the value.

     

    %INCIDENT_ID= GTR-207862

    %STATUS= En Proceso

    %zWorkspaceSolution= COMUNICACIONES.INSTALACIONES.FALLA DE ENERGÍA ELÉCTRICA

     

    should be

     

    %INCIDENT_ID=GTR-207862

    %STATUS=En Proceso

    %zWorkspaceSolution=COMUNICACIONES.INSTALACIONES.FALLA DE ENERGÍA ELÉCTRICA

     

    J.W.



  • 6.  Re: variables do not respond
    Best Answer

    Posted Feb 23, 2016 11:33 AM

    as mentioned by Alexander. the field need to be stored with the datatype defined in your schema.

    so we you need to store that data in the database as an integer like suggested by Alex you will need to convert the string provided in your email to the corresponding integer value.

    The only way to do that will be to extend the text_api.spl with your own function. You will need to create one function per object (cr/chg/iss/etc)

    something like this pseudo code in is own spl file:

     

    cr:: lookup_zWorkspaceSolution_by_name (...){

     

    string WSSolutionName;

    object resultList;

    WSSolutionName = argv[0];

            send_wait(0, top_object(), "call_attr", "zWorkspaceSolution", "sync_fetch", "STATIC", format("sym = %s AND delete_flag=0", WSSolutionName), -1, 0);
          
                  resultList = msg[0];

                  if (msg[1] > 0) {
                                  set_error(1);
                                  set_return_data(""); 
                  } else {

                        set_return_data(msg[0]);

                  }

    return

    }

     

    Then you can refer your new function in the text_api.cfg with something like:

    INCIDENT.ZWORKSPACESOLUTION_PERSID = zWorkspaceSolution.INTEGER.lookup_zWorkspaceSolution_by_name

    Note that this is code written on the fly here with no est at all and at the end of my day so to be tested carefully and nothing is supported by CA there.

    Hope this help to put you on the way.

    /J