How to create an incident using the pdm_text_cmd such that a value for a custom field is also saved in the new ticket
search cancel

How to create an incident using the pdm_text_cmd such that a value for a custom field is also saved in the new ticket

book

Article ID: 20131

calendar_today

Updated On:

Products

CA Service Desk Manager CA Service Management - Service Desk Manager

Issue/Introduction

This document provides a step-by-step procedure for using a string-type custom field with the pdm_text_cmd.

The basic solution is to add the relevant entry to $NX_ROOT\site\mods\text_api.cfg,.

If necessary, create your own custom method and reference it in the entry - the details of how to do that are not included here.

Environment

Release: 12.6 or higher
Component:  CA Service Desk Manager

Resolution

  1. Using Web Screen Painter, create your custom field using Tools -> Schema Designer. Save and Publish the change. Recycle Service Desk Manager services.

    In my test, I created the custom field as follows:

    Right-click on cr in the object listing that appears on the left panel of the Schema Designer. Select: Add Column. Enter the column name, test1, in
    the New Column Name field that appears in the popup window and click OK. In the right panel, the Column Info tab for ztest1 should now open. In the
    Field Type, select STRING from the dropdown, and for the String Length, enter: 30

  2. Copy $NX_ROOT\site\text_api.cfg to $NX_ROOT\site\mods\text_api.cfg.

  3. Edit the new file, $NX_ROOT\site\mods\text_api.cfg. Search for "INCIDENT.STRING6=string6.STRING". Insert the following line after that
    one:

    INCIDENT.ZTEST1=ztest1.STRING

    In my test, I also searched for "REQUEST.STRING6=string6.STRING" inserted this line after it:

    REQUEST.ZTEST1=ztest1.STRING

  4. Stop Service Desk Manager services.

  5. Start Service Desk Manager services.

  6. To test out the usage of the custom field, create the following file in the current directory, $NX_ROOT\site\mods:

    test1.txt
    and have it contain only these 5 lines:

    %TYPE=I
    %ASSIGNEE=ServiceDesk
    %CUSTOMER_NAME=ServiceDesk
    %ZTEST1=hello
    %REQUESTOR=ServiceDesk

  7. Run the following command:

    pdm_text_cmd -f test1.txt -u ServiceDesk -t REQUEST

  8. As a result of the previous step, you should receive these messages:

    AHD58021:Successfully Created Request 61.

    Original Input:

    %TYPE=I
    %ASSIGNEE=ServiceDesk
    %CUSTOMER_NAME=ServiceDesk
    %ZTEST1=hello
    %REQUESTOR=ServiceDesk
    %FROM_USERID=ServiceDesk

  9. Log into Service Desk and confirm that the ticket was created.

  10. If you have the custom field added to the CA Service Desk Manager graphical user interface (GUI), you can now verify the value of the field in the incident that was created (in the example above, this is Incident 61). If you don't have the custom field available to you via the GUI yet, you could check the Call_Req table in the database directly or run a pdm_extract command to retrieve the corresponding Call_Req data for the new ticket.