1

I'm trying to create issues in Bitbucket with the Windows CURL command, but it doesn't work, I'm getting this error message:

{"type": "error", "error": {"message": "No import job started"}}

My command CURL:

curl -u username:password -X GET https://api.bitbucket.org/2.0/repositories/name/name2/issues/import -H "Content-Type: application/json" --data @data.jsonson

I'm trying to send the following result in JSON:

{
"title": "title"
 }

But it doesn't work.

Does anyone know how I can create issues?

1 Answers1

0

I suppose, you should use a different URL path for posting issues, please see here for post method. It should be like this: https://api.bitbucket.org/2.0/repositories/username/reponame/issues For posting just an issue with a title you could use this:

curl --ssl-no-revoke -u username@password -X POST -H "Content-Type: application/json" -d "{\"title\" : \"test2\"}" https://api.bitbucket.org/2.0/repositories/username/reponame/issues

To post a content of the issue use content tag:

curl --ssl-no-revoke -u username@password -X POST -H "Content-Type: application/json" -d "{\"title\" : \"test2\",\"content\": {\"raw\": \"just test text\", \"markup\": \"plaintext\"}}"  https://api.bitbucket.org/2.0/repositories/username/reponame/issues

For example for me this worked (it's my private repo):

curl --ssl-no-revoke -u myaccountname@mypasswordname -X POST -H "Content-Type: application/json" -d "{\"title\" : \"test2\",\"content\": {\"raw\": \"just test texts\", \"markup\": \"plaintext\"}}" https://api.bitbucket.org/2.0/repositories/dvmochalov/testrepo/issues 

--ssl-no-revoke - works only for windows curl and it's just in case if you are running Windows with antivirus software or working with proxy.

Dmitry.M
  • 2,833
  • 1
  • 17
  • 30