How to trigger build feature branch when one pull request is created for this feature branch?
I need trigger one build for feature branch when one pull request is created for it. but seems, any change to develop branch will trigger this build. so I wanted to narrow the trigger condition in VCS trigger-> branch filter, but it dosn't trigger build again. could you help on it? I need only trigger build for new pull request, and need display the the feature branch instead of pull request branch as branch name in teamcity build. thanks!


The version of teamcity and bitbucket:
TeamCity Enterprise 10.0.5 (build 42677)
Atlassian Bitbucket v4.14.5
Please sign in to leave a comment.
Hi Ivy,
the branch specification in the VCS Settings will tell TeamCity which branches should be watched. Non-watched branches will not trigger any kind of event at all, as TeamCity will not have knowledge of their contents. TeamCity will also never trigger builds or anything else for non-watched branches.
The Branch filter thus has to be applied over the set of branches delimited in the branch specification. In your scenario, you only track "feature/*", thus only those builds will trigger. Over that specification, you could, for example, disable builds for "feature/wrong_feature" by adding it to the filter with a "-:feature/wrong_feature", but you can't add non-watched branches to the filter with a +, they don't exist for TeamCity.
If you want to trigger builds on pull-requests, then you need to add those to the branch specification, then to the branch filter.
If the build triggered is on the branch "pull-requests/*", then that's the branch teamcity will show. If the trigger is built on "feature/*", then that's the branch it will be shown. You can't really trigger a branch on "refs/pull-requests/*" and show it being built on "feature/*". If you want to categorize them as such, it would be recommended to group those set of branches under a project for that category.
If I missed something or you want more explanations, feel free to ask.