atlassian-python-api icon indicating copy to clipboard operation
atlassian-python-api copied to clipboard

[Bitbucket Server] Fork Repository for different project

Open srshiva opened this issue 1 year ago • 1 comments

Function fork_repository_new_project in bitbucket module is throwing error while trying to create.

Traceback (most recent call last): File "venv\lib\site-packages\atlassian\rest_client.py", line 400, in raise_for_status j.get("errorMessages", list()) + [k + ": " + v for k, v in j.get("errors", dict()).items()] AttributeError: 'list' object has no attribute 'items' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "venv\lib\site-packages\atlassian\bitbucket_init_.py", line 893, in fork_repository_new_project print(url,data=body) File "venv\lib\site-packages\atlassian\rest_client.py", line 310, in post response = self.request( File "venv\lib\site-packages\atlassian\rest_client.py", line 243, in request self.raise_for_status(response) File "venv\lib\site-packages\atlassian\rest_client.py", line 403, in raise_for_status response.raise_for_status() File "venv\lib\site-packages\requests\models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: for url:

srshiva avatar Aug 26 '22 10:08 srshiva

data = bitbucket.fork_repository_new_project( project_key="PROJ1", repository_slug="repo1", new_repository_slug="rep02", new_project_key="PROJ2" )

This is working as expected but not the bitbucket.fork_repository_new_project("PROJ1", "repo1", "rep02","PROJ2")

srshiva avatar Aug 26 '22 11:08 srshiva

The function signature is:

def fork_repository_new_project(self, project_key, repository_slug, new_project_key, new_repository_slug):

You should change the order of the last two arguments.

Spacetown avatar Nov 07 '22 20:11 Spacetown

Thanks @Spacetown

srshiva avatar Nov 08 '22 14:11 srshiva