Right now i see that only pull request URL is supplied through the notification. Is it possible to modify either the azure devops connector or modify azure repos subscription in microsoft teams to include approval as well
-
1The entire premise of this question is flawed. There's no point in using approvals on PRs if the reviewers are just rubber-stamping them as "approved" without taking the time to actually look through the code first. If you don't want people to review the PR, don't require approvals. – Daniel Mann Jun 19 '20 at 16:14
3 Answers
First off, with the default connector, I didn't see that possibility. We have a similar use case and we use a LogicApp or Power Automate to do what you want with REST API calls.
Link to the documentation: https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull%20requests/get%20pull%20request?view=azure-devops-rest-5.1
However, why have pull request approval policies if someone won't even look into the changes and approve them?

- 907
- 1
- 7
- 18
-
1*However, why have pull request approval policies if someone won't even look into the changes and approve them?* This is the answer to the question. There's no point in using approvals on PRs if the reviewers are just rubber-stamping them as "approved" without taking the time to actually look through the code first. – Daniel Mann Jun 19 '20 at 16:14
-
The initial thought was that the code changes would be visible in teams. i suppose that feature is not yet available. I agree that it doesnt make sense if there a lot of code changes. I was only exploring for options. We have abandoned this approach and only send PR created notifications to teams – Vaish Jun 22 '20 at 04:44
As others have mentioned, 'rubber stamping' Pull Requests goes against their intent. However, if you are looking for a command approach to Pull Requests, one does exist in the form of the Azure CLI.
The following command would approve a Pull Request:
az repos pr set-vote --id {id} --vote approve
Take a look at the docs to learn more: https://learn.microsoft.com/en-us/cli/azure/ext/azure-devops/repos/pr?view=azure-cli-latest#ext-azure-devops-az-repos-pr-set-vote
Installation for Azure CLI can be found here: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latest&tabs=azure-cli

- 1,980
- 2
- 22
- 32
Is it possible to approve pull requests from azure repos in micorsoft teams?
Agree with Daniel. It is unreasonable to approve PR directly in teams without reviewing the PR content.
But it is a good choice to display the alert of PR in teams, so that we can directly click alert to direct to PR.
To display the PR in the teams, you could check below document how to get the Pull Request Alerts in Microsoft Teams:
VSTS Pull Request Alerts in Microsoft Teams
Hope this helps.

- 71,098
- 10
- 114
- 135