Edits the issue from a JSON representation. This example updates the issue having key = "SCRUM-15". A successful update is indicated by a response status code equal to 204 with an empty response body.
curl -X PUT --user jira@example.com:JIRA_API_TOKEN \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '
{
"update": {
"summary": [
{
"set": "Bug in business logic"
}
],
"labels": [
{
"add": "triaged"
},
{
"remove": "blocker"
}
]
},
"fields": {
"customfield_10010": 1
},
"historyMetadata": {
"type": "myplugin:type",
"description": "text description",
"descriptionKey": "plugin.changereason.i18.key",
"activityDescription": "text description",
"activityDescriptionKey": "plugin.activity.i18.key",
"actor": {
"id": "tony",
"displayName": "Tony",
"type": "mysystem-user",
"avatarUrl": "http://mysystem/avatar/tony.jpg",
"url": "http://mysystem/users/tony"
},
"generator": {
"id": "mysystem-1",
"type": "mysystem-application"
},
"cause": {
"id": "myevent",
"type": "mysystem-event"
},
"extraData": {
"keyvalue": "extra data",
"goes": "here"
}
},
"properties": [
{
"key": "key1",
"value": "can be set at issue create or update time"
},
{
"key": "key2",
"value": "and there can be multiple properties"
}
]
}' \
--url 'https://your-domain.atlassian.net/rest/api/2/issue/SCRUM-15'
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
set rest = Server.CreateObject("Chilkat_9_5_0.Rest")
' URL: https://your-domain.atlassian.net/rest/api/2/issue/SCRUM-15
bTls = 1
port = 443
bAutoReconnect = 1
success = rest.Connect("your-domain.atlassian.net",port,bTls,bAutoReconnect)
If (success <> 1) Then
Response.Write "<pre>" & Server.HTMLEncode( "ConnectFailReason: " & rest.ConnectFailReason) & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( rest.LastErrorText) & "</pre>"
End If
success = rest.SetAuthBasic("jira@example.com","JIRA_API_TOKEN")
set json = Server.CreateObject("Chilkat_9_5_0.JsonObject")
success = json.UpdateString("update.summary[0].set","Bug in business logic")
success = json.UpdateString("update.labels[0].add","triaged")
success = json.UpdateString("update.labels[1].remove","blocker")
success = json.UpdateNumber("fields.customfield_10010","1")
success = json.UpdateString("historyMetadata.type","myplugin:type")
success = json.UpdateString("historyMetadata.description","text description")
success = json.UpdateString("historyMetadata.descriptionKey","plugin.changereason.i18.key")
success = json.UpdateString("historyMetadata.activityDescription","text description")
success = json.UpdateString("historyMetadata.activityDescriptionKey","plugin.activity.i18.key")
success = json.UpdateString("historyMetadata.actor.id","tony")
success = json.UpdateString("historyMetadata.actor.displayName","Tony")
success = json.UpdateString("historyMetadata.actor.type","mysystem-user")
success = json.UpdateString("historyMetadata.actor.avatarUrl","http://mysystem/avatar/tony.jpg")
success = json.UpdateString("historyMetadata.actor.url","http://mysystem/users/tony")
success = json.UpdateString("historyMetadata.generator.id","mysystem-1")
success = json.UpdateString("historyMetadata.generator.type","mysystem-application")
success = json.UpdateString("historyMetadata.cause.id","myevent")
success = json.UpdateString("historyMetadata.cause.type","mysystem-event")
success = json.UpdateString("historyMetadata.extraData.keyvalue","extra data")
success = json.UpdateString("historyMetadata.extraData.goes","here")
success = json.UpdateString("properties[0].key","key1")
success = json.UpdateString("properties[0].value","can be set at issue create or update time")
success = json.UpdateString("properties[1].key","key2")
success = json.UpdateString("properties[1].value","and there can be multiple properties")
success = rest.AddHeader("Content-Type","application/json")
success = rest.AddHeader("Accept","application/json")
set sbRequestBody = Server.CreateObject("Chilkat_9_5_0.StringBuilder")
success = json.EmitSb(sbRequestBody)
set sbResponseBody = Server.CreateObject("Chilkat_9_5_0.StringBuilder")
success = rest.FullRequestSb("PUT","/rest/api/2/issue/SCRUM-15",sbRequestBody,sbResponseBody)
If (success <> 1) Then
Response.Write "<pre>" & Server.HTMLEncode( rest.LastErrorText) & "</pre>"
End If
respStatusCode = rest.ResponseStatusCode
If (respStatusCode >= 400) Then
Response.Write "<pre>" & Server.HTMLEncode( "Response Status Code = " & respStatusCode) & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( "Response Header:") & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( rest.ResponseHeader) & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( "Response Body:") & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( sbResponseBody.GetAsString()) & "</pre>"
End If
%>
</body>
</html>