Update issue
/issues/issues/v3/issues/{issueId}
Request
-
Accept: string
Default Value:
object
-
attachments(optional):
array attachments
-
ccs(optional):
array ccs
-
comments(optional):
array comments
-
commits(optional):
array commits
-
component(optional):
object Component
-
creationDate(optional):
string(date-time)
-
customFields(optional):
object customFields
Additional Properties Allowed: additionalProperties
-
deadline(optional):
string(date-time)
-
description(optional):
string
-
duplicates(optional):
object duplicates
-
estimatedTime(optional):
number(double)
-
externalLinks(optional):
array externalLinks
-
foundInRelease(optional):
string
-
id(optional):
integer(int32)
-
links(optional):
array links
-
modificationDate(optional):
string(date-time)
-
owner(optional):
object User
-
priority(optional):
object Priority
-
product(optional):
object Product
-
release(optional):
object Release
-
remainingTime(optional):
number(double)
-
reporter(optional):
object User
-
resolution(optional):
object Resolution
-
severity(optional):
object Severity
-
sprint(optional):
object Sprint
-
status(optional):
object Status
-
storyPoints(optional):
number(double)
-
subIssues(optional):
object subIssues
-
summary(optional):
string
-
sumOfSubIssuesEstimatedTime(optional):
number(double)
-
sumOfSubIssuesRemainingTime(optional):
number(double)
-
sumOfSubIssuesStoryPoints(optional):
number(double)
-
sumOfSubIssuesTimeSpent(optional):
number(double)
-
tags(optional):
array tags
-
timeSpent(optional):
array timeSpent
-
type(optional):
string
-
url(optional):
string
-
version(optional):
string
-
wikiRenderedDescription(optional):
string
object
object
-
components(optional):
array components
-
defaultComponent(optional):
object Component
-
description(optional):
string
-
id(optional):
integer(int32)
-
isActive(optional):
boolean
Default Value:
false
-
links(optional):
array links
-
name(optional):
string
-
releases(optional):
array releases
-
releaseTags(optional):
array releaseTags
object
-
id(optional):
integer(int32)
-
isActive(optional):
boolean
Default Value:
false
-
isOpen(optional):
boolean
Default Value:
false
-
links(optional):
array links
-
sortkey(optional):
integer(int32)
-
value(optional):
string
object
object
-
attachmentData(optional):
array attachmentData
-
byteSize(optional):
integer(int32)
-
creationDate(optional):
string(date-time)
-
description(optional):
string
-
filename(optional):
string
-
id(optional):
integer(int32)
-
issueHandle(optional):
object IssueHandle
-
links(optional):
array links
-
mimeType(optional):
string
-
submitter(optional):
object User
-
url(optional):
string
array
Response
200 Response
object
-
attachments(optional):
array attachments
-
ccs(optional):
array ccs
-
comments(optional):
array comments
-
commits(optional):
array commits
-
component(optional):
object Component
-
creationDate(optional):
string(date-time)
-
customFields(optional):
object customFields
Additional Properties Allowed: additionalProperties
-
deadline(optional):
string(date-time)
-
description(optional):
string
-
duplicates(optional):
object duplicates
-
estimatedTime(optional):
number(double)
-
externalLinks(optional):
array externalLinks
-
foundInRelease(optional):
string
-
id(optional):
integer(int32)
-
links(optional):
array links
-
modificationDate(optional):
string(date-time)
-
owner(optional):
object User
-
priority(optional):
object Priority
-
product(optional):
object Product
-
release(optional):
object Release
-
remainingTime(optional):
number(double)
-
reporter(optional):
object User
-
resolution(optional):
object Resolution
-
severity(optional):
object Severity
-
sprint(optional):
object Sprint
-
status(optional):
object Status
-
storyPoints(optional):
number(double)
-
subIssues(optional):
object subIssues
-
summary(optional):
string
-
sumOfSubIssuesEstimatedTime(optional):
number(double)
-
sumOfSubIssuesRemainingTime(optional):
number(double)
-
sumOfSubIssuesStoryPoints(optional):
number(double)
-
sumOfSubIssuesTimeSpent(optional):
number(double)
-
tags(optional):
array tags
-
timeSpent(optional):
array timeSpent
-
type(optional):
string
-
url(optional):
string
-
version(optional):
string
-
wikiRenderedDescription(optional):
string
object
object
-
components(optional):
array components
-
defaultComponent(optional):
object Component
-
description(optional):
string
-
id(optional):
integer(int32)
-
isActive(optional):
boolean
Default Value:
false
-
links(optional):
array links
-
name(optional):
string
-
releases(optional):
array releases
-
releaseTags(optional):
array releaseTags
object
-
id(optional):
integer(int32)
-
isActive(optional):
boolean
Default Value:
false
-
isOpen(optional):
boolean
Default Value:
false
-
links(optional):
array links
-
sortkey(optional):
integer(int32)
-
value(optional):
string
object
object
-
attachmentData(optional):
array attachmentData
-
byteSize(optional):
integer(int32)
-
creationDate(optional):
string(date-time)
-
description(optional):
string
-
filename(optional):
string
-
id(optional):
integer(int32)
-
issueHandle(optional):
object IssueHandle
-
links(optional):
array links
-
mimeType(optional):
string
-
submitter(optional):
object User
-
url(optional):
string
array
400 Response
array
404 Response
array
406 Response
array
409 Response
array
Examples
The example on this page shows how to update the status of an issue from "UNCONFIRMED" to "NEW" by submitting a PUT request on the REST resource using curl.
curl -i
-X PUT
-s
-H "Accept: application/vnd.oracle.resource+json" -H "Content-type: application/vnd.oracle.resource+json"
-d@issue
https://myinstance.oraclecloud.com/myorg/rest/myorg_pubapi_203132/issues/v3/issues/1
Before this command could be issued, several actions must have preceded it:
-
Retrieve the value of the "status" object from the issues repository.
The "status" property is an object with its own properties. The entire object must be an exact match with one of the status objects in the repository database. The issue was initially created with a status of "UNCONFIRMED", which is the object:
{"id":1,"value":"UNCONFIRMED","isActive":true,"isOpen":true,"sortkey":100}
To update the status to "NEW", you must specify the entire JSON representation that corresponds to the "NEW" status. To do that, you must know the value of all its properties. To retrieve the value, you query the
issues/v3/repository
resource and use the "field=" query parameter to limit the results that are returned. The server will return only the objects that pertain to "status". The example for the Return repository data endpoint shows how to perform this query.The query returns data for every possible status, including the following object for "NEW":
{"id":2,"value":"NEW","isActive":true,"isOpen":true,"sortkey":200},
-
Retrieve the issue (1) and save its JSON representation in a file (
issue
).curl -i -X GET -H "Accept: application/vnd.oracle.resource+json" -H "Content-type: application/vnd.oracle.resource+json" -s https://myinstance.oraclecloud.com/myorg/rest/myorg_pubapi_2031372/issues/v3/issues/1 >issue
-
Edit the file:
-
Remove the root resource "issue" and the trailing closing curly brace (}).
-
Replace the "status" JSON object with the object that corresponds to "NEW", copying its value from the response to the query made to the repository.
-
Save the file.
-
-
Update the issue with the PUT request that is shown at the top of the page.
Notice that the command uses
?H
parameters to specify the Accept and Content-type for the body of the response. These parameters must be specified for all Issues API PUT and POST operations.
Example of Response Header
The following shows an example of the response header.
200 Successful Operation
Content-Type: application/vnd.oracle.resource+json
Date: Thu, 17 Aug 2017 00:26:10 GMT
Example of Response Body
The following example shows the contents of the response body in JSON format,if the request was successful. The entire JSON representation for the newly created issue is returned in a single line. The output has been formatted to improve readability. The updated status is shown in bold.
{"issue":{
"links":[
{"rel":"self",
"href":"http://developer.us.oraclecloud.com/dev-org-org/rest/dev-org_pubapi_203132/issues/v2/issues/1"},
{"rel":"canonical",
"href":"http://developer.us.oraclecloud.com/dev-org/rest/dev-org_pubapi_203132/issues/v2/issues/1"},
{"rel":"create-form",
"href":"http://developer.us.oraclecloud.com/dev-org/rest/dev-org_pubapi_203132/issues/v2/issues/create-form"},
{"rel":"collection",
"href":"http://developer.us.oraclecloud.com/dev-org/rest/dev-org_pubapi_203132/issues/v2/issues"},
{"rel":"search-form",
"href":"http://developer.us.oraclecloud.com/dev-org/rest/dev-org_pubapi_203132/issues/v2/issues/search-form"}
],
"id":1,
"version":"1498782045181",
"creationDate":1498782045175,
"modificationDate":1498782045181,
"summary":"New Story",
"description":"",
"wikiRenderedDescription":"",
"tags":[],
"sumOfSubIssuesEstimatedTime":0,
"remainingTime":0,
"sumOfSubIssuesRemainingTime":0,
"sumOfSubIssuesStoryPoints":0,
"url":"http://developer.us.oraclecloud.com/dev-org/rest/dev-org_pubapi_203132/task/1",
"type":"Story",
"externalLinks":[],
"reporter":{
"id":1,
"loginName":"joe@example.com",
"realname":"Joe",
"gravatarHash":"68aa64f7d0abfd8929c261f78b60fd27"},
"ccs":[
{"id":1,
"loginName":"joe@example.com",
"realname":"Joe",
"gravatarHash":"68aa64f7d0abfd8929c261f78b60fd27"}
],
"severity":{
"id":4,
"value":"normal",
"sortkey":400},
"status":{ "id":1, "value":"NEW", "isActive":true, "isOpen":true, "sortkey":200},
"priority":{
"id":3,
"value":"Normal",
"sortkey":300},
"release":{
"id":1,
"value":"---",
"sortkey":0,
"product":{
"id":1}
},
"product":{
"id":1,
"name":"Default",
"description":"default product",
"isActive":true},
"subIssues":[],
"timeSpent":[],
"sumOfSubIssuesTimeSpent":0,
"attachments":[],
"duplicates":[],
"customFields":{
"iteration":"---"},
"commits":[],
"comments":[]
}}