Enforce naming convention for repository names

I would like to enforce a stricter naming convention for repository names, which I can do by implementing listeners for repository events. This works fine; however, Stash has a built-in validation which runs first. So if the user enters e.g. a name containing '/', an error message in red is displayed:

  Repository names are limited to 128 characters. They must start
with a letter or number and may contain spaces, hyphens,
underscores and periods

If the user corrects the name and tries again, the event listener will run and possibly cancel the repo change again, but with a different error message. This is confusing to the end user. Is there a way of configuring or hooking into the built-in validation?

1 answer


It seems you have mostly succeeded in achieving your aim of enforcing naming conventions. ScriptRunner for Stash solves this particular problem.

If you simply want to view the documentation, you can find how ScriptRunner for Stash achieves this in the Naming Standard Enforcement section.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,751 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you