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 JSON webhook payload received by the event source
  • headers - the headers of the received HTTP request
  • parameters - the query parameters of the received 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 a webhook 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}}