Excel Jira - Issues: Assign Issue

Back to Index

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"

Documentation: https://developers.atlassian.com/cloud/jira/platform/rest/#api-api-2-issue-issueIdOrKey-assignee-put

CURL Command

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'

Excel Example

Dim rest As Chilkat.Rest
Set rest = Chilkat.NewRest

'  URL: https://your-domain.atlassian.net/rest/api/2/issue/SCRUM-15/assignee

bTls = True

port = 443

bAutoReconnect = True
success = rest.Connect("your-domain.atlassian.net",port,bTls,bAutoReconnect)
If (success <> True) Then
    Debug.Print "ConnectFailReason: "; rest.ConnectFailReason
    Debug.Print rest.LastErrorText
    Exit Sub
End If

success = rest.SetAuthBasic("jira@example.com","JIRA_API_TOKEN")

Dim json As Chilkat.JsonObject
Set json = Chilkat.NewJsonObject
success = json.UpdateString("name","matt")

success = rest.AddHeader("Content-Type","application/json")
success = rest.AddHeader("Accept","application/json")

Dim sbRequestBody As Chilkat.StringBuilder
Set sbRequestBody = Chilkat.NewStringBuilder
success = json.EmitSb(sbRequestBody)
Dim sbResponseBody As Chilkat.StringBuilder
Set sbResponseBody = Chilkat.NewStringBuilder
success = rest.FullRequestSb("PUT","/rest/api/2/issue/SCRUM-15/assignee",sbRequestBody,sbResponseBody)
If (success <> True) Then
    Debug.Print rest.LastErrorText
    Exit Sub
End If


respStatusCode = rest.ResponseStatusCode
If (respStatusCode >= 400) Then
    Debug.Print "Response Status Code = "; respStatusCode
    Debug.Print "Response Header:"
    Debug.Print rest.ResponseHeader
    Debug.Print "Response Body:"
    Debug.Print sbResponseBody.GetAsString()
    Exit Sub
End If