I've worked on projects with a Jira integration where I simply had to include the ticket number in the commit or branch name and that work would automatically link with the ticket in Jira. Exe:
git commit -am '123 some commit'
And on the ticket you'd see a link to the commit.
How can I do that with Azure Dev Ops?
I know how to manually do it via Visual Studio or in the ticket itself, but I want to do it through the command line only.
You can link work items to existing builds from the Add link dialog. From the Links tab of a work item, choose Add link>Existing item. From the Add link dialog, choose one of the build link types—Build, Found in build, Integrated in build— and specify the build number.
GitHub link types are system-defined link types. They support linking work items to GitHub objects as shown in the following image.
Switch to the Azure DevOps browser tab. Navigate to Repos | Branches. Click New branch. Enter a name of “release” for the new branch.
You can link a work item in Azure Boards to a commit in Azure Repos by specifying the work item ID after a pound sign. Eg, to update work item #3, you need to mention #3
in the commit message. (The pound sign - #
is required, it won't parse bare numbers and try to link work items.)
For example:
git commit -m"Update bug #3"
Produces a bidirectional link between the commit and the work item. You can see this in the commit details, in the work item tab:
And you can see this in the work item details, in the "Development" section:
For those wondering why their commits aren't auto-linking to work items for some of their repositories - this is a feature you can turn on per repository:
Within Project Settings | Repositories navigate to the repository that isn't auto linking, and then under Settings enable "Commit mention linking" (and potentially "Commit mention work item resolution"):
You may find that this is disabled by default for Forks, whilst it's enabled by default for brand new repositories.
There is no way to automatically link branches to work items; unless you create the branch from the work item directly, using the "New Branch" button or "create a branch" link:
Note: This link only exists if there are no other Development links on the work item - you have to use the "Add Link" dialog after that.
There is an open ticket for that functionality: https://developercommunity.visualstudio.com/t/automatically-link-a-work-item-to-branches-when-co/809745
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With