Add Tasks to New Pull Requests

This listener adds a default list of tasks to new pull requests (PR) where the condition matches. This is useful when you want to remind developers of some common administrative tasks that people sometimes forget to do, for instance update the documentation or ensure there are unit tests for new code.

To add one of these listeners, follow these steps:

  1. Navigate to Admin > Listeners > Create Listener.
  2. Select Add Tasks to New Pull Requests.
  3. Add a Note to describe the listener. 
  4. Select what Projects/Repositories you want the tasks to apply to.
  5. Add Conditions for the new tasks by writing code on the Script tab or uploading existing code on the File tab. 
    You can select Show Snippets to copy and paste examples in the field, such as Current User in a Particular Group.
  6. Enter a comment for the tasks to be attached to.
    For example: Please remember to complete the following tasks: 
  7. Enter the tasks to be completed in Tasks

    For Bitbucket version 6.x and below, use a new line for each new task: 

    For Bitbucket version 7.x and newer, use Add Task to add multiple tasks. The tasks can span multiple lines and contain markdown syntax

  8. Enter the User the tasks will be added as. 
  9. Select Add or Update

Result: When a PR is created in any configured repository, the above tasks results in:

Bitbucket version 6.x and below: 

For Bitbucket version 7.x and newer:

It makes sense to combine this with the PR setting to require all tasks to be resolved.