Update an issue
/*/issues/issues/v2/issues/{issueId}
Request
object
- attachments
-
Type:
array
attachments - ccs
-
Type:
array
ccs - comments
-
Type:
array
comments - commits
-
Type:
array
commits - component
-
Type:
object
Component - creationDate
-
Type:
string
(date-time
) - customFields
-
Type:
object
customFieldsAdditional Properties Allowed: additionalProperties - deadline
-
Type:
string
(date-time
) - description
-
Type:
string
- duplicates
-
Type:
array
duplicates - estimatedTime
-
Type:
number
(double
) - externalLinks
-
Type:
array
externalLinks - foundInRelease
-
Type:
string
- id
-
Type:
integer
(int32
) - links
-
Type:
array
links - modificationDate
-
Type:
string
(date-time
) - owner
-
Type:
object
User - priority
-
Type:
object
Priority - product
-
Type:
object
Product - release
-
Type:
object
Release - remainingTime
-
Type:
number
(double
) - reporter
-
Type:
object
User - resolution
-
Type:
object
Resolution - severity
-
Type:
object
Severity - sprint
-
Type:
object
Sprint - status
-
Type:
object
Status - storyPoints
-
Type:
number
(double
) - subIssues
-
Type:
array
subIssues - summary
-
Type:
string
- sumOfSubIssuesEstimatedTime
-
Type:
number
(double
) - sumOfSubIssuesRemainingTime
-
Type:
number
(double
) - sumOfSubIssuesStoryPoints
-
Type:
number
(double
) - sumOfSubIssuesTimeSpent
-
Type:
number
(double
) - tags
-
Type:
array
tags - timeSpent
-
Type:
array
timeSpent - type
-
Type:
string
- url
-
Type:
string
- version
-
Type:
string
- wikiRenderedDescription
-
Type:
string
array
-
Type:
object
Attachment
array
-
Type:
string
object
array
array
-
Type:
object
ExternalLink
object
- gravatarHash
-
Type:
string
- id
-
Type:
integer
(int32
) - links
-
Type:
array
links - loginName
-
Type:
string
- realname
-
Type:
string
object
- id
-
Type:
integer
(int32
) - links
-
Type:
array
links - sortkey
-
Type:
integer
(int32
) - value
-
Type:
string
object
- components
-
Type:
array
components - defaultComponent
-
Type:
object
Component - description
-
Type:
string
- id
-
Type:
integer
(int32
) - isActive
-
Type:
boolean
Default Value:false
- links
-
Type:
array
links - name
-
Type:
string
- releases
-
Type:
array
releases - releaseTags
-
Type:
array
releaseTags
object
object
- id
-
Type:
integer
(int32
) - links
-
Type:
array
links - sortkey
-
Type:
integer
(int32
) - value
-
Type:
string
object
- id
-
Type:
integer
(int32
) - links
-
Type:
array
links - sortkey
-
Type:
integer
(int32
) - value
-
Type:
string
object
- id
-
Type:
integer
(int32
) - links
-
Type:
array
links - name
-
Type:
string
object
- id
-
Type:
integer
(int32
) - isActive
-
Type:
boolean
Default Value:false
- isOpen
-
Type:
boolean
Default Value:false
- links
-
Type:
array
links - sortkey
-
Type:
integer
(int32
) - value
-
Type:
string
array
object
- attachmentData
-
Type:
array
attachmentData - byteSize
-
Type:
integer
(int32
) - creationDate
-
Type:
string
(date-time
) - description
-
Type:
string
- filename
-
Type:
string
- id
-
Type:
integer
(int32
) - issueHandle
-
Type:
object
IssueHandle - links
-
Type:
array
links - mimeType
-
Type:
string
- submitter
-
Type:
object
User - url
-
Type:
string
array
-
Type:
string
(byte
)
object
- id
-
Type:
integer
(int32
) - version
-
Type:
string
object
- href
-
Type:
string
- mediaType
-
Type:
string
- method
-
Type:
string
- profile
-
Type:
string
- rel
-
Type:
string
object
object
- kind
-
Type:
string
- links
-
Type:
array
links - type
-
Type:
string
- uri
-
Type:
string
array
array
-
Type:
object
ReleaseTag
object
- id
-
Type:
integer
(int32
) - links
-
Type:
array
links - value
-
Type:
string
object
- description
-
Type:
string
- id
-
Type:
integer
(int32
) - links
-
Type:
array
links - name
-
Type:
string
object
Response
object
- attachments
-
Type:
array
attachments - ccs
-
Type:
array
ccs - comments
-
Type:
array
comments - commits
-
Type:
array
commits - component
-
Type:
object
Component - creationDate
-
Type:
string
(date-time
) - customFields
-
Type:
object
customFieldsAdditional Properties Allowed: additionalProperties - deadline
-
Type:
string
(date-time
) - description
-
Type:
string
- duplicates
-
Type:
array
duplicates - estimatedTime
-
Type:
number
(double
) - externalLinks
-
Type:
array
externalLinks - foundInRelease
-
Type:
string
- id
-
Type:
integer
(int32
) - links
-
Type:
array
links - modificationDate
-
Type:
string
(date-time
) - owner
-
Type:
object
User - priority
-
Type:
object
Priority - product
-
Type:
object
Product - release
-
Type:
object
Release - remainingTime
-
Type:
number
(double
) - reporter
-
Type:
object
User - resolution
-
Type:
object
Resolution - severity
-
Type:
object
Severity - sprint
-
Type:
object
Sprint - status
-
Type:
object
Status - storyPoints
-
Type:
number
(double
) - subIssues
-
Type:
array
subIssues - summary
-
Type:
string
- sumOfSubIssuesEstimatedTime
-
Type:
number
(double
) - sumOfSubIssuesRemainingTime
-
Type:
number
(double
) - sumOfSubIssuesStoryPoints
-
Type:
number
(double
) - sumOfSubIssuesTimeSpent
-
Type:
number
(double
) - tags
-
Type:
array
tags - timeSpent
-
Type:
array
timeSpent - type
-
Type:
string
- url
-
Type:
string
- version
-
Type:
string
- wikiRenderedDescription
-
Type:
string
array
-
Type:
object
Attachment
array
-
Type:
string
object
array
array
-
Type:
object
ExternalLink
object
- gravatarHash
-
Type:
string
- id
-
Type:
integer
(int32
) - links
-
Type:
array
links - loginName
-
Type:
string
- realname
-
Type:
string
object
- id
-
Type:
integer
(int32
) - links
-
Type:
array
links - sortkey
-
Type:
integer
(int32
) - value
-
Type:
string
object
- components
-
Type:
array
components - defaultComponent
-
Type:
object
Component - description
-
Type:
string
- id
-
Type:
integer
(int32
) - isActive
-
Type:
boolean
Default Value:false
- links
-
Type:
array
links - name
-
Type:
string
- releases
-
Type:
array
releases - releaseTags
-
Type:
array
releaseTags
object
object
- id
-
Type:
integer
(int32
) - links
-
Type:
array
links - sortkey
-
Type:
integer
(int32
) - value
-
Type:
string
object
- id
-
Type:
integer
(int32
) - links
-
Type:
array
links - sortkey
-
Type:
integer
(int32
) - value
-
Type:
string
object
- id
-
Type:
integer
(int32
) - links
-
Type:
array
links - name
-
Type:
string
object
- id
-
Type:
integer
(int32
) - isActive
-
Type:
boolean
Default Value:false
- isOpen
-
Type:
boolean
Default Value:false
- links
-
Type:
array
links - sortkey
-
Type:
integer
(int32
) - value
-
Type:
string
array
object
- attachmentData
-
Type:
array
attachmentData - byteSize
-
Type:
integer
(int32
) - creationDate
-
Type:
string
(date-time
) - description
-
Type:
string
- filename
-
Type:
string
- id
-
Type:
integer
(int32
) - issueHandle
-
Type:
object
IssueHandle - links
-
Type:
array
links - mimeType
-
Type:
string
- submitter
-
Type:
object
User - url
-
Type:
string
array
-
Type:
string
(byte
)
object
- id
-
Type:
integer
(int32
) - version
-
Type:
string
object
- href
-
Type:
string
- mediaType
-
Type:
string
- method
-
Type:
string
- profile
-
Type:
string
- rel
-
Type:
string
object
object
- kind
-
Type:
string
- links
-
Type:
array
links - type
-
Type:
string
- uri
-
Type:
string
array
array
-
Type:
object
ReleaseTag
object
- id
-
Type:
integer
(int32
) - links
-
Type:
array
links - value
-
Type:
string
object
- description
-
Type:
string
- id
-
Type:
integer
(int32
) - links
-
Type:
array
links - name
-
Type:
string
object
object
- cause
-
Type:
object
Throwable - detail
-
Type:
string
- localizedMessage
-
Type:
string
- message
-
Type:
string
- stackTrace
-
Type:
array
stackTrace - status
-
Type:
integer
(int32
) - suppressed
-
Type:
array
suppressed
object
- localizedMessage
-
Type:
string
- message
-
Type:
string
- stackTrace
-
Type:
array
stackTrace - suppressed
-
Type:
array
suppressed
array
-
Type:
object
StackTraceElement
array
-
Type:
object
StackTraceElement
array
object
- className
-
Type:
string
- fileName
-
Type:
string
- lineNumber
-
Type:
integer
(int32
) - methodName
-
Type:
string
- nativeMethod
-
Type:
boolean
Default Value:false
object
- cause
-
Type:
object
Throwable - detail
-
Type:
string
- localizedMessage
-
Type:
string
- message
-
Type:
string
- stackTrace
-
Type:
array
stackTrace - status
-
Type:
integer
(int32
) - suppressed
-
Type:
array
suppressed
object
- localizedMessage
-
Type:
string
- message
-
Type:
string
- stackTrace
-
Type:
array
stackTrace - suppressed
-
Type:
array
suppressed
array
-
Type:
object
StackTraceElement
array
-
Type:
object
StackTraceElement
array
object
- className
-
Type:
string
- fileName
-
Type:
string
- lineNumber
-
Type:
integer
(int32
) - methodName
-
Type:
string
- nativeMethod
-
Type:
boolean
Default Value:false
object
- cause
-
Type:
object
Throwable - detail
-
Type:
string
- localizedMessage
-
Type:
string
- message
-
Type:
string
- stackTrace
-
Type:
array
stackTrace - status
-
Type:
integer
(int32
) - suppressed
-
Type:
array
suppressed
object
- localizedMessage
-
Type:
string
- message
-
Type:
string
- stackTrace
-
Type:
array
stackTrace - suppressed
-
Type:
array
suppressed
array
-
Type:
object
StackTraceElement
array
-
Type:
object
StackTraceElement
array
object
- className
-
Type:
string
- fileName
-
Type:
string
- lineNumber
-
Type:
integer
(int32
) - methodName
-
Type:
string
- nativeMethod
-
Type:
boolean
Default Value:false
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. For more information about cURL, see Use cURL. For more information about endpoint URL structure, see Send Requests.
curl -i
-X PUT
-s -H 'Content-type:application/json' -d@issue
http://developer.us.oraclecloud.com/dev-org/rest/dev-org_pubapi_203132/issues/v2/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/v2/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 -s http://developer.us.oraclecloud.com/dev-org/rest/dev-org_pubapi_2031372/issues/v2/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 the
–H
parameter to specify the Content-type for the body of the response. This parameter must be specified for all PUT and POST operations.
Example of Response Header
The following shows an example of the response header.
200 Successful Operation
Content-Type: application/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":[]
}}