Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Templates: Get/craft the name of the suggested branch name

Dmitry Kireev
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 8, 2023

Hello everyone,

 

I'd like to craft/get a name of the suggested branch name via a smart templates.

For instance, if the ID of the ticket is PRJ-1 and the title is Backend API Created the branch name suggested by JIRA would be suggested as `PRJ-1-backend-api-created`.

Is there a way I can get it? Maybe there is a way to sanitize the title in excatly the same way via smart templates?

 

Thanks.

 

UPDATE 1:
I guess the key would be to use `replaceAll()` but I'm yet to find the regex that would be 1:1 with what branch name generator uses.

UPDATE 2:
I ended up with the following regex-based snippet: `.trim().toLowerCase().replaceAll("[^A-Za-z0-9]"," ").replaceAll(" {2,}"," ").trim().replaceAll(" ","-")

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events