Passing variables to be used in a Service Desk Manager notification method.
search cancel

Passing variables to be used in a Service Desk Manager notification method.

book

Article ID: 21471

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager CA Service Desk Manager

Issue/Introduction

The following describes how to pass variables in a script to write data into a text file when using a notification method

Environment

Service Desk Manager 14.1 and 17.x

All Supported Operating Systems

Resolution

The below example shows how to write the data like ticket number, person name into a text file when a Service Desk Manager (SDM) ticket is 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 Administration Tab -> Expand Events and Macros -> 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 BatchFile
    Macro Type : Execute Remote Reference
    Object Type : Request/Incident/Problem
  4. Create the new macro as follows:
    Symbol                   : Launch BatchFile
    Record Status : Active
    Object Type : Request/Incident/Problem
    Macro Type : Execute Remote Reference
    Remote Reference : Launch BatchFile
    Parameters 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 BatchFile
    Code : LBatchFile
    Record Status : Active
    Architecture Type : win
    NT Server, Unix Command : ${NX_ROOT}/bin/launchit test.bat
  6. Create a new event called Launch BatchFile as follows:
    Name                     : Launch BatchFile
    Object Type : Request/Incident/Problem
    Record Status : Active Configuration Information
    Delay Time : 00:00:05
    Repeat Delay Time : 00:00:00
    Allow Time resetting Checkbox is checked
    Save History is selected
    Condition : 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 set to 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 peformed Services or a Services Consultant and will be a paid engagement. Services can be contacted through your Account Manager. This document is for educational purposes only.

Additional Information

In Step #4 above, any field that could potentially have spaces in its content (i.e. Ticket Description) must have the variable enclosed in double-quotes (i.e. "@{description}")

Once the text file is written, you custom script can read this file and use the info to integrate with other external applications.