Forums

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

Trying to fork a repo and set team ownership from command line on windows

Jonas_Nilsson
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!
January 17, 2019

Hi.

I'v trying to fork a boileplate repo and set team ownership. My colleague has it working on his mac. It's not working on Windows. 

The code runs. My repo is being forked, but the ownership is set to my user.

It appears that the following code fails:
(The capitalized words are set to the correct values when I execute the code)

shellExec(`curl -D- -u USERNAME:PASSWORD -X POST https://api.bitbucket.org/2.0/repositories/MYTEAM/MYREPO/forks --header 'Content-Type: application/json' --data '{ "name": "NEWREPONAME", "is_private" : true, "project" : { "key" : "UN", "name": "MYPROJECT", "type": "project" }, "owner": { "username": "MYTEAM" } }'`)

I'm getting the following error:

(node:8220) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): SyntaxError: Unexpected token u in JSON at position 0
(node:8220) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Any clue as to what is wrong?

 

1 answer

0 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 29, 2019

Hi Jonas,

Teams can not be set as owners of a repository. This is because teams are no longer accessible with Team ID and password, now every member needs to use their own credentials to access the team. You'll need to choose someone from the team to be the owner of the repository. 

Can you try setting a different user and let us know how it goes?

Best regards,

Ana

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events