Scripted variables is javascript that is executed and assigned to a variable to use anywhere in your web action config, such as the post body, the url ie by its name in mustache syntax.
Usage: {{ variable-name }}
Creata a Javascript variable
Click the Variabels tab
Choose Javascript variables on the toggle
Click Add button
Click in the MyVar field and rename the variable
Write the script in the script field. More info below regarding usage
Script usage
The script must return a value, this value is assigned to the variable name and used in the configuration by entering mustache syntax.
The script has the following context already provided as variables to use;
response | the response of the parent action in raw text |
jsonResponse() | a function that turns the response into json object |
context | raw context of the action, such as name, url, method, headers |
jsonContext() | a function that turns the context into json object. |
path(anyObject, jsonpath) | a function that returns the value in the object specified by the path. |
getIssue() | return the issue as json if exists else null |