How to pass the variables in a script to write the data in text file which will be used in Notification method in CA Service Desk 12.5.

Document ID : KB000021471
Last Modified Date : 14/02/2018
Show Technical Document Details

The below example shows how to write the data like ticket number, person name in the text file when a ticket will be opened.

  1. Create a batch file called test.bat under $NX_ROOT\bin directory with the below text
    Echo %1 %2 %3 %4 %5 >> %1.txt
  2. Click the Administration Tab -> Expand Events and Macros -> Select macros and click on the Create new button that appears in the Right hand frame.

  3. Create a new Remote Reference Macro as follows and click on the Continue Button
    Symbol                   : Launch BatchFileMacro Type               : Execute Remote ReferenceObject Type              : Request/Incident/Problem
  4. Create the new macro as follows:
    Symbol                   : Launch BatchFileRecord Status            : ActiveObject Type              : Request/Incident/ProblemMacro Type               : Execute Remote ReferenceRemote Reference         : Launch BatchFileParameters to Command    : @{ref_num} @{description} @{priority}@{customer.combo_name} @{customer.phone_number}NT Server, Unix Command  : ${NX_ROOT}/bin/launchit test.bat
  5. The New Remote Reference "Launch BatchFile" that is attached to the Execute Remote Reference is as follows:
    Symbol                   : Launch BatchFileCode                     : LBatchFileRecord Status            : ActiveArchitecture Type        : winNT Server, Unix Command  : ${NX_ROOT}/bin/launchit test.bat
  6. Create a new event called Launch BatchFile as follows:
    Name                     : Launch BatchFileObject Type              : Request/Incident/ProblemRecord Status            : Active Configuration Information Delay Time               : 00:00:05Repeat Delay Time        : 00:00:00Allow Time resetting Checkbox is checkedSave History is selectedCondition                : Req. Status = Open Event Action Information: We added the Execute remote reference macro  test  and  Add an Activity Log" under Actions on True.
  7. Now manually attach this Event to any ticket which has the status as Open

  8. Once the initial event delay time is passed the batch file test.bat creates a text file with name {ticket number}.txt and fills it with the @{ref_num} @{description} @{priority} @{customer.combo_name} @{customer.phone_number} under the $NX_ROOT\bin directory.

    Note: The batch file would be a customization done by CA services or a Services Consultant and will be a paid engagement. CA Services can be contacted through your local account representative. This document is for educational purpose only.