Skip to main content

Feature branch format - optional Pipeline setting

Set up templates for your feature branches when creating new features associated with a ticket

Written by Mateusz Kochanowicz

Gearset teams using Pipelines can select a template for all feature branches that are created through the Dev Sandbox New feature flow.
​
Access this flow by clicking any Dev Sandbox in the Pipelines UI, then selecting New feature.

This lets you assign a ticket when creating a new feature in Gearset Pipelines.

Minimum requirements:
​- To use this feature in Gearset Pipelines, you need to have an issue tracking system connection added to the Source control and services page.


​Note: This setting is disabled by default if you don't have an issue tracking system enabled in your pipeline.

In that case, you'll see this notification when configuring your pipeline settings:

"You must enable an issue tracking system to set a branch name template.".

How to set feature branch format

To set a naming template for your feature branches, select the cog icon on the Pipelines UI page, then go to Edit pipeline details > Feature branch format.
​
​

These variables are available:

  • [id]

  • [story_name]

You can then set the template however you need, using these variables as placeholder for ticket data that will be replaced when creating a new feature.

Hovering over the variable pills shows a tooltip with details, and clicking on it appends the variable to the branch format.

Feature branch format with Jira

Setting feature branch format to [id] pre-fills the branch name using the Jira project key.

Project keys are unique keys to identify a Jira project (more information in Jira documentation).

Example 1 - [id]

In this example, a new feature is created using the [id] template.


The project key is set in Jira under Project settings > Project key, as shown below.

Example 2 - [id] / [story_name]

Setting the template to [id]/[story_name] uses the Jira project key and ticket name for the branch name.

Example of a feature branch template in Gearset:

And this is how the ticket looks in Jira:

Feature branch format with Azure work items

As with Jira, the branch name uses either the Azure work item ID or ID / Title, depending on your feature branch format setting.
The demo below shows both options for Azure work items:

And in Azure DevOps, this is where the ID and Title details are being pulled from:

Did this answer your question?