Is there a way to POST MERGED pull-request?
This is what I tried, but it didn't work:
This is my curl command:
curl -H 'Authorization: Bearer ************' -H "Content-Type: application/json" -X POST https://stash.sd.comp.com/rest/api/1.0/projects/MYPROJ/repos/MergeTest/pull-requests -d @./MigrateFiles/MergeTest/361807.json
This is the json file:
{
"title": "one more dream",
"description": "(created by ABA) ",
"state": "MERGED",
"open": false,
"closed": true,
"fromRef": {
"id": "refs/heads/mergedpull",
"repository": {
"slug": "MergeTest",
"name": null,
"project": {
"key": "MYPROJ"
}
}
},
"toRef": {
"id": "refs/heads/master",
"repository": {
"slug": "MergeTest",
"name": null,
"project": {
"key": "MYPROJ"
}
}
},
"reviewers": [
{
"user": {
"name": "sbamani"
}
}
]
}
It does creates the pull-request but it creates it OPEN:
{"id":14,"version":0,"title":"one more dream","description":"(created by ABA)","state":"OPEN","open":true,"closed":false,
Thanks,
Sharon
Hey Sharon!
The concept of creating a Pull Request is to be able to perform a review of the code. So it's not possible to create and merge at the same time a PR.
You can create a PR and merge it by REST API's on separate steps. The endpoints to perform these actions are the below:
Regards
Rodrigo - Atlassian Support
The need came because we were migrating from gitlab and we wanted to keep the PR info.
Is there a better way to do it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sharon
In order to move repositories, you will need to follow the steps in the Importing code from an existing project documentation.
This will keep your commit history, but not things such as comments. We still have an open feature request for this BSERV-4586.
You may also want to check out the following Atlassian Answers posts for more details. Some customers have designed scripts to automate this:
* https://answers.atlassian.com/questions/273025/gitlab-to-stash-migration
* https://answers.atlassian.com/questions/274693/looking-for-answers-on-migration-from-gitlab-to-stash
Regards
Rodrigo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Rodrigo M: Thanks above info. API documentation must include this information. API doc making an airhead.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.