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
- Go to Environment > Automation.
- On the right pane, click Create Automation.
- In the To use as list, select Data Retriever.
- In the Choose Automation Category list, select one of the automation categories.
- In the Apply template list, select a template that you want to use as a base for creating your script.
In the Script integration server list, select that integration server that you want to use for connecting with the external system.
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.- In the Resource Name box, specify a unique name to identify your data retriever automation script.
- In the Render as list, select one of the following options:
- List—To render the output of the script as a list.
- Table—To render the output of the script as a table.
- Tree—To render the output of the script as a tree.
- 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. - In the Script type list, select one of the following options:
- Template—To save the script as a template for future use.
- System—To save the script as a base script that can be only viewed or copied but not modified by anyone apart from the Administrator.
- User—To save the script as a normal script for your personal use and available for viewing, copying, and modifying.
- In the Maps to list, select one of the following options:
- None—Not to map the script with a ticket or component.
- Ticket—To 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.
- Component—To 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.
- To save the script, click Add script.
- (Optional) To make the script available for other users, change the imported automation script status to a state other than Draft.
Related topics