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'
#include <CkRest.h>
#include <CkJsonObject.h>
#include <CkStringBuilder.h>
void ChilkatSample(void)
{
CkRest rest;
bool success;
// URL: https://your-domain.atlassian.net/rest/api/2/issue/SCRUM-15/assignee
bool bTls = true;
int port = 443;
bool bAutoReconnect = true;
success = rest.Connect("your-domain.atlassian.net",port,bTls,bAutoReconnect);
if (success != true) {
std::cout << "ConnectFailReason: " << rest.get_ConnectFailReason() << "\r\n";
std::cout << rest.lastErrorText() << "\r\n";
return;
}
rest.SetAuthBasic("jira@example.com","JIRA_API_TOKEN");
CkJsonObject json;
json.UpdateString("name","matt");
rest.AddHeader("Content-Type","application/json");
rest.AddHeader("Accept","application/json");
CkStringBuilder sbRequestBody;
json.EmitSb(sbRequestBody);
CkStringBuilder sbResponseBody;
success = rest.FullRequestSb("PUT","/rest/api/2/issue/SCRUM-15/assignee",sbRequestBody,sbResponseBody);
if (success != true) {
std::cout << rest.lastErrorText() << "\r\n";
return;
}
int respStatusCode = rest.get_ResponseStatusCode();
if (respStatusCode >= 400) {
std::cout << "Response Status Code = " << respStatusCode << "\r\n";
std::cout << "Response Header:" << "\r\n";
std::cout << rest.responseHeader() << "\r\n";
std::cout << "Response Body:" << "\r\n";
std::cout << sbResponseBody.getAsString() << "\r\n";
return;
}
}