How can I create a new pull request with author?

I’m unable to set the author for a new pull request. For whatever reason, when I create a new PR, the author becomes whoever I’ve used to authenticate with (in this case the repository owner), and not the set author on the request object.

For example, for the following request:

{
   "title":"Auto generated Pull Request Test LPHZ0",
   "source":{
      "branch":{
         "name":"EZ-1234"
      }
   },
   "destination":{
      "branch":{
         "name":"master"
      }
   },
   "state":"OPEN",
   "author":{
      "username":"ttesterton",
      "website":"",
      "display_name":" Tony Testerton",
      "uuid":"{xxxx-xxxx-xxxx-xxxx-xxxx-xxxx}",
      "links":{

      },
      "created_on":"2016-01-14T05:27:35.146257+00:00",
      "is_staff":false,
      "location":null,
      "type":"user"
   },
   "close_source_branch":false
}

The pull request gets created, but instead of ttesterton being the author, it’s the repository owner. How can I specify the PR author for the new Pull Request via the API, version 2.0?

But what if I don’t want you creating Pull Requests with me as the author! :wink:

The short answer is that you have to use OAuth 2.0. In order to impersonate users, you have to ask them for permission first. But, assuming the target user will grant it, then your application can call the API on his/her behalf to create the PR, making that person the author.

I have similar issue creating Bitbucket pull requests from Jira via Git for Jira integration, it creates PR with an author different from my Jira user. How to change this behavior?

Disappointing answer, although I agree it should require some admin level permission to do, it should be possible somehow. I’ve got a complex situation where I would like the merging of one pipeline to automatically update another repository and auto-create the PR. Ideally the automatically generated PRs would have the same author as the one that started the cascade. BTW git does allow this, git commit -am "Automated Branch for $namespace $tag" --author="$COMMITTER_NAME" worked to set the commit author.