I am seeing error - repo doesn't exist, while trying to raise pr via bitbucket rest endpoint

Sravya Nalla September 7, 2023

I am trying to raise pr from (example data) master branch of 

https://{bitbucket_base_url.com}/users/sravya/repos/sample_repo/browse

to 

master branch of https://{bitbucket_base_url.com}/projects/my_project_key/repos/sample_repo/browse.

Endpoint i am using : 

https://{bitbucket_base_url.com}/rest/api/1.0/projects/my_project_key/repos/sample_repo/pull-requests
Payload : 
payload = {
    "title": "Hi",
    "description": "Hello",
    "state": "OPEN",
    "open": True,
    "closed": False,
    "fromRef": {
        "id": "refs/heads/master",
        'repository': {
            'slug': "sample_repo",
            'name': None,
            'project':{
                'key':'sravya'
            }
        }
    },
    "toRef": {
        "id": "refs/heads/master",
        'repository': {
            'slug': "sample_repo",
            'name': None,
            'project':{
                'key':'my_project_key'
            }
        }
    },
    "locked": False,
    # "reviewers": [
    #     {
    #         "user": {
    #             "name": "sravya"    
    #         }
    #     },
    # ]
}
i am getting  404 - {"errors":[{"context":null,"message":"Repository sravya/sample_repo does not exist.","exceptionName":null}. can someone help??

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events