Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the ticket status after pull request is completed

I am using Git with Visual Studio and Azure DevOps. I am trying to complete a pull request and also change the ticket status.

Currently, you can do this by selecting the "Complete linked work items after merging". The problem is that this sets the status of the ticket to Done.

Is there any way for the ticket status to be set with a different option on the completion of the pull request?

It would also be nice to set a ticket status when you create a pull request...

like image 911
ZombieCode Avatar asked Jul 10 '19 06:07

ZombieCode


People also ask

How do I edit a pull request?

In the "Pull Requests" list, click the pull request you'd like to modify. Next to the pull request's title, click Edit. In the base branch drop-down menu, select the base branch you'd like to compare changes against. Read the information about changing the base branch and click Change base.

How do I undo a pull request in DevOps?

Revert a completed pull requestOpen the completed PR and select Revert. This action creates a new branch with changes that undo the PR in an existing target branch in your repo. In the Revert pull request pane: Under Target branch, select the branch where you want to undo the PR changes.

How do you edit a pull request in Azure DevOps?

You need to edit your code in your PR source branch and commit the changes in to update the PR, and If you are a reviewer of the pull request, you can a add comments to the review codes changes .


2 Answers

So this is actually in Azure Devops now - Set Work Item State in Pull Request

Don't use Complete linked work items after merging if you don't want the Work Item to be closed. ;)

To set the status of Work Item 123 to resolved instead of closed, in your PR description write:

Resolved: #123

This feature is useful if you want change multiple tickets and uses the syntax {state value}: #ID. For example, to close a Task and resolve a User Story at the same time.

Resolved: #123
Closed: #456

However it does rely on developers knowing and using the convention instead of it being a managed policy across the organisation.

like image 117
Gordon McAllister Avatar answered Oct 16 '22 23:10

Gordon McAllister


Yes, agree with Shayki's answer. There does not such feature support by Azure Devops. Until now, this is a fixed option that you just can change it as completed while you complete the PR.

But, as work around, you can install an extension WorkItem Updater which can change work item while build executed. And then, add the task WorkItem Updater into your build. In that task, you can change it as any state you want.

enter image description here

I know, this is not convenience for you to achieve what you want.

But also, here has an UserVoice raised on Microsoft Developer Community which is our main forum for product feature suggestions : Customize Work Item State after PR is closed.

Note: You can vote and add your comment there. This UserVoice is already Under Review, I believe it will be meet soon.

like image 20
Mengdi Liang Avatar answered Oct 16 '22 22:10

Mengdi Liang