Defines when the task should complete. The Jython expression should be a single-line boolean expression or a multi-line script with the boolean value assigned to the result variable. Show {{expanded ? 'less' : 'more'}}...

The following bindings are exposed to the condition:

  • event - the payload received by the event source (in case of HTTP webhook JSON payload)
  • headers - optional headers of the received event (in case of HTTP request HTTP headers)
  • parameters - optional parameters of the received event (in case of HTTP request)

Nested fields can be referenced using dot syntax - event.pull_request.title, or using square brackets in case the field name contains special characters - headers['X-GitHub-Event']. If the referenced field is not present, an exception will be thrown and the task will fail.

Example of a valid Jython expression:

headers['X-GitHub-Event'] == 'pull_request' and event.repository.name == 'Hello-World' and event.pull_request.base.ref == 'master' and 'BUILD' in event.pull_request.labels

If an event matches the condition, the task will complete, otherwise it will stay in progress. The task will fail if an exception is thrown by the script.

Output properties

{{task.outputVarHelpText}}