With this hook, you can set up Bitbucket to change the state of a given issue, based on the commit message in an update. The Issues hook scans commit messages for keywords. You can use these keywords to automatically change the state of an issue on your repository's issue tracker.
If you enabled an issue tracker on your repository after August 2012, the Issue hook is enabled automatically for you. Older repositories with older issue trackers may or may not have this hook enabled. You can check if this hook is enabled by going to the Hooks tab on your repository settings:
If you are having trouble with the hook, see Troubleshooting Bitbucket hooks.
Enabling the hook manually
- Log into Bitbucket and navigate to the repository you want to modify.
- Click the settings icon .
- Click Hooks on the left-hand side of the screen.
- Select the Issues hook from the Select a hook list.
- Click Add hook. That's it – done.
Putting the Issue Keywords into your Commit Message
To link commit to an issue from a commit message, include an command-issue pair somewhere in your commit message. This pair takes the following format:
You can link to a single issue or multiple issues. The
<issue id> can take an of the following forms:
You should always include the # (pound sign or hash mark) if you to ensure that links back to the issue resolve. If you omit the # (pound sign or hash mark), links from a changeset do not resolve.
Each action supports multiple
<command> keywords. The following table lists the actions you can perform through a commit and the acceptable commands for that action. All the keywords are case insensitive. So, for example, both
Close work to close an issue.
|resolve an issue|
|reopen an issue|
|mark an issue on hold|
|mark an issue wontfix|
|mark an issue invalid|
|link to a changeset for the issue|
re bug #55