How do I change the Assignee using CURL - Jira Rest API?
I tried the following:
curl -D- -u "[email address]:[token]" -X PUT --data @@jqlassignuser.json -H "Content-Type: application/json" https://p97networks.atlassian.net/rest/api/2/issue/ACB-65/assignee > results.tx
where jqlassignuser.json contains the following:
{
"fields": {
"assignee": {
"name": "charles.teague"
}
}
}
Here are the results:
{"errorMessages":["Unrecognized field \"fields\" (Class com.atlassian.jira.rest.v2.issue.UserBean), not marked as ignorable\n at [Source: org.apache.catalina.connector.CoyoteInputStream@11835c39; line: 1, column: 14] (through reference chain: com.atlassian.jira.rest.v2.issue.UserBean[\"fields\"])"]}
Changing the the json file to the following worked:
{"accountId": "557058:d166e0cb-9558-43a2-99ff-36636f97f02a"}
I got the accountId by writing a .Net project in c# and used Atlassian.Net to query for an issue assigned to "charles.teague". The accountId is in the issue.AssigneeUser.AccountId property, which was set when calling the following:
Jira jira = Jira.CreateRestClient(jiraData.Url, jiraData.UserName, jiraData.PasswordToken);
Issue issue = await jira.Issues.GetIssueAsync(issueKey);
with the following set:
Note: You can delete the token when you are finished.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.