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:
- Navigate to Admin > Listeners > Create Listener.
- Select Add Tasks to New Pull Requests.
- Add a Note to describe the listener.
- Select what Projects/Repositories you want the tasks to apply to.
- 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. - Enter a comment for the tasks to be attached to.
For example: Please remember to complete the following tasks: 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.
- Enter the User the tasks will be added as.
- 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.