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'
// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;
import android.app.Activity;
import com.chilkatsoft.*;
import android.widget.TextView;
import android.os.Bundle;
public class SimpleActivity extends Activity {
private static final String TAG = "Chilkat";
// Called when the activity is first created.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
CkRest rest = new CkRest();
boolean success;
// URL: https://your-domain.atlassian.net/rest/api/2/issue/SCRUM-15/assignee
boolean bTls = true;
int port = 443;
boolean bAutoReconnect = true;
success = rest.Connect("your-domain.atlassian.net",port,bTls,bAutoReconnect);
if (success != true) {
Log.i(TAG, "ConnectFailReason: " + String.valueOf(rest.get_ConnectFailReason()));
Log.i(TAG, rest.lastErrorText());
return;
}
rest.SetAuthBasic("jira@example.com","JIRA_API_TOKEN");
CkJsonObject json = new CkJsonObject();
json.UpdateString("name","matt");
rest.AddHeader("Content-Type","application/json");
rest.AddHeader("Accept","application/json");
CkStringBuilder sbRequestBody = new CkStringBuilder();
json.EmitSb(sbRequestBody);
CkStringBuilder sbResponseBody = new CkStringBuilder();
success = rest.FullRequestSb("PUT","/rest/api/2/issue/SCRUM-15/assignee",sbRequestBody,sbResponseBody);
if (success != true) {
Log.i(TAG, rest.lastErrorText());
return;
}
int respStatusCode = rest.get_ResponseStatusCode();
if (respStatusCode >= 400) {
Log.i(TAG, "Response Status Code = " + String.valueOf(respStatusCode));
Log.i(TAG, "Response Header:");
Log.i(TAG, rest.responseHeader());
Log.i(TAG, "Response Body:");
Log.i(TAG, sbResponseBody.getAsString());
return;
}
}
static {
System.loadLibrary("chilkat");
// Note: If the incorrect library name is passed to System.loadLibrary,
// then you will see the following error message at application startup:
//"The application <your-application-name> has stopped unexpectedly. Please try again."
}
}