When you build a chain, you can use the results—or outputs—from a command in subsequent commands. For example:
- To perform multiple transformations on a command's comma-separated values (CSV) output as part of a chain, add a subsequent Tabular Transformation command that uses the earlier command's output as as input.
- To parse a command's output—such as unstructed data from a Script Runner command—into a useful value, add a dynamic output to extract the value.
Note: Commands can only use outputs from commands earlier in the chain, including those linked with a Success condition or within a serial group. Commands can't use outputs from other commands in the same parallel group, or the command from an interator command.
Connection commands produce several types of outputs:
|Text||Selected records from a listing file output|
|Integer||The number of records in a query|
|File||Downloaded response from a web service HTTP request|
|Float||The results of a floating point calculation|
|Date||The system timestamp|
|JSON||REST API web services response|
|List||The list of files in a directory|
|Map||A list of pairs and values|
Using a Command Output As an Input for Another Command
To use an earlier command's output as an input for a command:
- In the chain, select the node of the command to add the input for, and click Edit .
- Under Command Properties, click Variable for the input.
- From the left panel, expand the earlier command, and then select its output to use as an input.
Adding Dynamic Outputs
To extract a value from the output of a command—such as unstructured data—for use by another command in a chain, create a dynamic output.
- In the chain, select the node of the command with the output to extract the value from, and click Edit .
- Select Dynamic Outputs , and click Add Dynamic Output.
- Enter a unique name to help identify the dynamic output.
- Select which of the command's outputs to transform.
- Enter the text to search for and extract from the output, and select whether to use an exact match or regular expression (regex).
- To search for the text within only specific lines of the output, enter the lines to check. You can separate lines by commas and use a hypen to specify a range, such as
- Under Output type, select whether to return a single output as a string or a list of outputs as JSON.
- Select whether to apply case-sensitivity to the search or trim matches to remove any leading or trailing whitespace.
- To verify the dynamic output works correctly, click Test and Submit.
Note: To remove a dynamic output from a command, click its Delete.
- Click Save.