Creating data retriever scripts


To perform certain actions in the external system, you require some necessary resources or data that must be retrieved from the external system. Data retriever scripts written in the Ruby programming language help extract that necessary data that also acts as input for particular automation scripts.

You can create new automation categories to sort your data retriever scripts. In addition, you can use one of your existing scripts with a Template type as a template for creating new scripts.

To create a data retriever script

  1. Go to Environment > Automation.
  2. On the right pane, click Create Automation.
  3. In the To use as list, select Data Retriever.
  4. In the Choose Automation Category list, select one of the automation categories.
  5. In the Apply template list, select a template that you want to use as a base for creating your script.
  6. In the Script integration server list, select that integration server that you want to use for connecting with the external system.

    Notes

    • When you select a server from the list, the details related to that integration server are automatically added to the script body.
    • You cannot add an integration server if the script body is empty.
    • A script that you do not plan to use for performing some actions in a particular target external system does not require an integration server.
  7. In the Resource Id box, specify a unique ID for the automation script that you want to create.
    This ID is referred to by the automation script at run time when you use the script in a step and run the request under which the step is added.

    Notes

    • The resource automation ID must not contain any spaces.
    • BMC recommends that you specify the ID in the format: companyAbbreviation_productAbbreviation_automationName.
       For example, bmc_brpm_executeCommand.
  8. In the Resource Name box, specify a unique name to identify your data retriever automation script.
  9. In the Render as list, select one of the following options:
    1. ListTo render the output of the script as a list.
    2. TableTo render the output of the script as a table.
    3. TreeTo render the output of the script as a tree. 
  10. In the Script body area, add the script including the arguments and the logic required for retrieving necessary data from the particular external system. 
    The resources that the script fetches, how it fetches it, and the manner in which it displays the output depends on the way you design the script body. For more information about designing the script body, see Designing-the-script-body-of-a-data-retriever-script.
  11. In the Script type list, select one of the following options:
    1. TemplateTo save the script as a template for future use.
    2. SystemTo save the script as a base script that can be only viewed or copied but not modified by anyone apart from the Administrator.
    3. UserTo save the script as a normal script for your personal use and available for viewing, copying, and modifying.
  12. In the Maps to list, select one of the following options:
    1. NoneNot to map the script with a ticket or component.
    2. TicketTo map this script to a ticket. When you do this, the script is available for use on the Tickets tab when you open a plan. This option can be used for creating specific automation scripts for retrieving data about tickets from an external system.
    3. ComponentTo map this script to a component. When you do this, the script is available for component mapping when you open one of the applications. This option can be used for creating specific data retriever scripts for mapping components with external objects.
  13. To save the script, click Add script.
  14. (Optional) To make the script available for other users, change the imported automation script status to a state other than Draft.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*