Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

how to create a pull request from terminal? getting '400 error'

John Pooley October 14, 2020

Currently using Bitbucket Server, I am trying to automate pull requests using a shell script. However I am getting the following error:

 

Parameter conditions "fork" not met for actual request parameters: create={}


Here is the curl command I am currently using:

 

curl -v https://MYHOST.MYSERVER/projects/AP/repos/$REPO/pullrequests?create \
-u $USERNAME:$PASSWORD \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"title": "$COMMIT_TEXT",
"description": "automated PR. $COMMIT_TEXT",
"fork_policy": "no_forks",
"source": {
"branch": {
"name": "$NEW_BRANCH"
}
"repository":{
"full_name":"$REPO"
}
},
"destination": {
"branch": {
"name": "develop"
}
}
, "close_source_branch": false
}'

 

1 answer

1 vote
Maciej Adamczak
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 14, 2020

Hi @John Pooley if that question is related to Bitbucket Server please take a look at REST API docs for creating the pull request:

https://docs.atlassian.com/bitbucket-server/rest/7.6.0/bitbucket-rest.html#idp293

Thanks,
Maciej Adamczak

 

John Pooley October 15, 2020

hi thank you. I believe this has gotten me somewhat further, I am now get this error:

 

XSRF Security Token Missing

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events