Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Conditions is available on Actions and can be set as Data Condition or HTTP Condition.

Conditions are found on each action by clicking the Conditions tab.

Conditions can be combined with AND, OR operators to build up the condition.

HTTP Condition

Enter a single HTTP status code or comma separated list of values, then the action will run only if the response from the previous call has one of the HTTP Status Codes.

...

Data Condition

Data Condition

...

Image Removedmakes it possible to access the data using JSON path expression https://www.npmjs.com/package/jsonpath.

Most cases it is enough using dot (.) notation to access variables in the scope, but sometimes it is necessary to use more advanced json path expressions.

Data conditions needs three input to be set JSON Path, Operand and Value.

Input

Description

Example

JSON Path

Path to the value of the variable in the scope.

$.issue.fields.status.name

Operand

EQUALS

Value

...

Arrays

You can use .length to get the length of the array and compare with a number

Example with 2 objects in an array.

Lets say you add a json path to an array like this

$.myArray.length

and there the scope contains an array like below;

Code Block
{
  "myArray":[{"id":"1"},{"id":"2"}]
}

then the result from the json path will be 2. Since it contains two objects {"id":"1"} and {"id":"2"}

Example with 0 objects in an array.

Lets say you add a json path to an array like this

$.myArray.length

and there the scope contains an array like below;

Code Block
{
  "myArray":[]
}

then the result from the json path will be 0. Since it contains no objects