How can I get the repositoryId in the Bamboo CLI

When I try to clone a plan and I need change the subversion repository for different plan. But it also need specify the repositoryId when I try to "updateRepository". I would like to have automation way to get the repositoryId. Is it possible do it via this CLI?

Thank you.

Yongjun Rong

5 answers


As workarround we execute a HTTP GET to:



<my_host>: your bamboo host:

<my_user>: your bamboo user

<my_password>: your bamboo password

<my_plankey>: is the combination "PROJECT-PLAN" for your project ('-' must be included).

Then you can parse the response and search for repositoryId.

I only test this on bamboo 4.4.5, but maybe works on others versions.


Good idea! Although I had to use buildKey instead of planKey for the releases I was testing with (4.2 and 5.0 EAP). Translating that into CLI terms, you can use:

--action renderRequest --quiet --request "/chain/admin/config/editChainRepository.action?buildKey=XXX-DEF" --findReplaceRegex ".*repositoryId=(\d+).*:\$1"

To get:

That only gets the first repository.

There isn't a way to list existing ones currently. Open an issue. If you run addRepository, then the repository id is returned on the command.

Thanks for your quick response. But need another getRepositoryId when specify and plan key and the repo name. No, I will try to access the db directly to get the id as a tempaory workaround.

I cannot use the addRepository because the repository is cloned when I try to clonePlan. I need updateRepository. Or when after clonePlan, it will be great if it can return the repositoryId

I will open an issue. Thank you again.

Sorry I cannot login to the onDemand

If you don't have an id already, click on: Create an account

Thanks Bob:

Just as a side note, on windows I had to remove the "\" scape character from \$ on:

So the final sentence that works on windows will be:

--action renderRequest --quiet --request "/chain/admin/config/editChainRepository.action?buildKey=XXX-DEF" --findReplaceRegex ".*repositoryId=(\d+).*:$1"


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

808 views 3 9
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