Assigns the issue to the user. Use this resource to assign issues for the users having “Assign Issue” permission, and not having the “Edit Issue” permission. If name body parameter is set to “-1” then automatic issue assignee is used. A name set to null will remove the assignee. A successful response is indicated by a 204 status code with no response body. This example assigns issue "SCRUM-15" to "matt"
curl -X PUT --user jira@example.com:JIRA_API_TOKEN \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '
{
"name": "matt"
}' \
--url 'https://your-domain.atlassian.net/rest/api/2/issue/SCRUM-15/assignee'
LOCAL loRest
LOCAL lnSuccess
LOCAL lnBTls
LOCAL lnPort
LOCAL lnBAutoReconnect
LOCAL loJson
LOCAL loSbRequestBody
LOCAL loSbResponseBody
LOCAL lnRespStatusCode
loRest = CreateObject('Chilkat_9_5_0.Rest')
* URL: https://your-domain.atlassian.net/rest/api/2/issue/SCRUM-15/assignee
lnBTls = 1
lnPort = 443
lnBAutoReconnect = 1
lnSuccess = loRest.Connect("your-domain.atlassian.net",lnPort,lnBTls,lnBAutoReconnect)
IF (lnSuccess <> 1) THEN
? "ConnectFailReason: " + STR(loRest.ConnectFailReason)
? loRest.LastErrorText
RELEASE loRest
CANCEL
ENDIF
loRest.SetAuthBasic("jira@example.com","JIRA_API_TOKEN")
loJson = CreateObject('Chilkat_9_5_0.JsonObject')
loJson.UpdateString("name","matt")
loRest.AddHeader("Content-Type","application/json")
loRest.AddHeader("Accept","application/json")
loSbRequestBody = CreateObject('Chilkat_9_5_0.StringBuilder')
loJson.EmitSb(loSbRequestBody)
loSbResponseBody = CreateObject('Chilkat_9_5_0.StringBuilder')
lnSuccess = loRest.FullRequestSb("PUT","/rest/api/2/issue/SCRUM-15/assignee",loSbRequestBody,loSbResponseBody)
IF (lnSuccess <> 1) THEN
? loRest.LastErrorText
RELEASE loRest
RELEASE loJson
RELEASE loSbRequestBody
RELEASE loSbResponseBody
CANCEL
ENDIF
lnRespStatusCode = loRest.ResponseStatusCode
IF (lnRespStatusCode >= 400) THEN
? "Response Status Code = " + STR(lnRespStatusCode)
? "Response Header:"
? loRest.ResponseHeader
? "Response Body:"
? loSbResponseBody.GetAsString()
RELEASE loRest
RELEASE loJson
RELEASE loSbRequestBody
RELEASE loSbResponseBody
CANCEL
ENDIF
RELEASE loRest
RELEASE loJson
RELEASE loSbRequestBody
RELEASE loSbResponseBody