Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Create, update and list issues from Bitbucket API V2 using CURL

Set variables

export user=my_user_email
export password=my_password
export org=my_org_or_my_user
export repo=my_repo_name

Create issue with CURL

curl --user $user:$password -X POST -H "Content-Type: application/json" \
""$org"/"$repo"/issues" \
--data '{"title":"title of the issue","content":{ "raw":"this should be the description"}, "fields": {"assignee": {"username": "ThomasG77"}}}'

Update issue changing title and assignee

curl ""$org"/"$repo"/issues/95" \
  --user $user:$password -X PUT -H 'Content-Type: application/json' \
  -d '{
  "title": "Updated title 1",
  "assignee": {
    "username": "ThomasG77"

List existing issues

curl --user $user:$password ""$org"/"$repo"/issues"

For using the API further

Finding the right entry was not so simple, so to keep in memory...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment