Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to specify a non-default repository for a vcs.commit or .branch task in yaml spec

margo September 28, 2022

Hello,

 

This question can be ignored, the issue was caused by the repository id being part of the yaml spec file. changing this to defaultRepository like shown below fixed the issue:

  - any-task:
      plugin-key: com.atlassian.bamboo.plugins.vcs:task.vcs.commit
      configuration:
        commitMessage: '"bamboo: committing something"'
        selectedRepository: defaultRepository

The question remains though: how would one specify a different repository in this case?

Is that only possible by hardcoding the repository ID to selectedRepository?

for some unclear reason sometimes plans using a linked repository suddenly fail at a create branch task with the following error:

Error occurred while running Task 'Create branch to commit changes to' of type com.atlassian.bamboo.plugins.vcs:task.vcs.branching.
com.atlassian.bamboo.task.TaskException: Repository id 302514704 is invalid. Please reselect from the configuration screen.

We had this before with plans created via UI and were then able to fix this issue by going to the repository page and simply hitting safe again. We of course dont have that option with spec created plans as these cannot be changed via UI.

2 questions:

1. How can we fix this for a spec created job and

2. what exactly is causing this error in the first place?

1 answer

1 accepted

0 votes
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 28, 2022

Hello @margo

You are right. You have to specify the Repository ID in quotes. For example:

- any-task:
plugin-key: com.atlassian.bamboo.plugins.vcs:task.vcs.commit
configuration:
commitMessage: message!
selectedRepository: '1114113'
description: Commit and push to repository

Kind regards,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events