Update issue over rest api

I am trying to update the original estimate and remaining estimate in an epic on our jira cloud instance. I am using postman with basic auth (the login has administrator privileges) and raw json for hte body. The base URL is http://example.atlassian.net/rest/api/latest/issue/PM-47 and the body parameter is the following json:

{
 	"timetracking":{  
         "originalEstimate":"2h",
         "remainingEstimate":"1h"
      }
 }

I do not get an error, but it also does not update the fields. I have also tried updating something simple like the summary, but I have the same outcome. I can successfully get data, but this is the first time I have tried to write data.

Hello @ajoiner,

You are missing fields in your request body. Doing a PUT /rest/api/3/issue/<issueKey> to edit summary and timetracking (given timetracking fields are on the right screen) you can use a request body like this

{
  "fields": {
    "summary": "Hello world edited",
    "timetracking": {
      "originalEstimate": "2h",
      "remainingEstimate": "1h"
    }
  }
}

Hope this helps.
Ian

@ianRagudo Thanks for the response. I tried exactly what you posted in the body, but it still did not update. I even tried the update command with no luck.

That’s interesting, @ajoiner. I tried the exact request body before I posted my previous response (I tried before posting this response) and was able to verify that it works. Can you try via CLI and post your exact command here? Please remove the authentication part. If there are errors in the CLI, please post them here too. Thanks.

Here’s my successful PUT call using postman for reference

Cheers,
Ian

One thing I noticed from your screenshot is that I am receiving a response status of 200 not 204.


When you say try over CLI what are you meaning? Is it a plugin or native to Jira Cloud?

Oops, I wasn’t clear with that, my apologies; what I meant was command-line interface. I was just wondering what your exact cUrl (or httpie) request-response would look like, but your postman screenshot is sufficient. Kindly change http to https and that should do the trick :slight_smile:

Cheers,
Ian

Changing to https fixed my problem. Thanks so much @ianRagudo for troubleshooting this.

2 Likes

I cannot believe I spent an hour trying to figure out why it doesn’t work when all I had to do was change from http to https

Great api UX!