Assignee to user in issue

igramnet February 5, 2019

Hello. I have Server Jira v7.11.2. I use API v.2. 

So, I want to change assignee to another user. How can I do that?

1. I haven't possibility to use URL like https://site.ru/rest/api/latest/issue/{ISSUE_KEY}/assignee. I see 405 error.

2. I tried an example

curl -D- -u fred:fred -X PUT --data {see below} -H "Content-Type: application/json" https://site.ru/rest/api/2/issue/{ISSUE_KEY}
{
"fields": {
"assignee":{"name":"harry"}
}
}

but it doesn't work.

1 answer

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 5, 2019

Hello,

What is the response text returned by your curl call?

igramnet February 5, 2019

Nothing. The Empty result. 

 

I tried this url

curl -D- -u username:pass -X PUT  --data {\"fields\": {\"assignee\":{\"name\":\"newuser\"}}} -H "Content-Type: application/json" https://site.ru/rest/api/2/issue/{ISSUE_KEY}

 

and gave

{"errorMessages":["Unexpected end-of-input within/between OBJECT entries\n at [Source: org.apache.catalina.connector.CoyoteInputStream@6aa8f474; line: 1, column: 21]"]}

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 5, 2019

You use rest api for Jira Server. Are you on Jira Server or Jira Cloud?

igramnet February 5, 2019

REST API for jira server (jira hosts on my server)

Suggest an answer

Log in or Sign up to answer