I have a couple of questions about branch policies in Azure Repos.
As you can see we have a branching strategy based on linked items in Azure DevOps.
My questions:
Is it possible to allow users push their changes to Main branch only if their branch is connected with some story?
And the second -- is it possible to allow users push changes to Story branch only if their task is child to story in which they are trying to push?
I have read all docs about polices and have not found anything appropriate
Or what policies could you recommend if nothing exists from the above
Is it possible to allow users push their changes to Main branch only if their branch is connected with some story?
I am afraid there is no such setting or way to achieve this at this moment.
We could noly set the Check for linked work items in the branch policy:
However, it is not yet possible to make more detailed requirements for the work items associated with the requirements at this time.
And the second -- is it possible to allow users push changes to Story branch only if their task is child to story in which they are trying to push?
Similar to your first question, there is no way to do additional requirements on associated work items.
To resolve this issue, we need to enable the option Check for linked work items and we could add the Automatically included reviewers to check type of connected workitems: