Update issue over rest api

rest-api

#1

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.


#2

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


#3

@iragudo 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.


#4

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


#5

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?


#6

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


#7

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