Jira REST change assignee example doesn't work

I'm attempting to use the example here: https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Edit+issues#JIRARESTAPIExample-Editissues-Exampleofassigninganissuetouser"harry"

I use this curl command:

curl -k -D- -u jsacco:xxxxxx -X PUT --data @UpdateFieldsJSON.txt -H "Content-Type: application/json" https://xxxxxx.atlassian.net/rest/api/latest/issue/GE-39

with this json data:

{

"fields":{

"assignee":{"name":"jsacco"}

}

}

and get this result:

HTTP/1.1 400 Bad Request

{"errorMessages":[],"errors":{"assignee":"Field 'assignee' cannot be set. It is not on the appropriate screen, or unknown."}}

According to the example, this should work, but it doesn't. Why doesn't this work?

As a side note, updating the assignee field directly works just fine as follows:

curl -k -D- -u jsacco:xxxxxx -X PUT --data @UpdateAssigneeJSON.txt -H "Content-Type: application/json" https://xxxxxx.atlassian.net/rest/api/latest/issue/GE-39/assignee

with this json data:
{"name":"jsacco"}

I don't understand why this should work if the former doesn't. I'd like to get the former working so I can update more than one field at a time.

2 answers

1 accepted

I got this working by adding the Assignee field to the list of fields available when editing an issue. The clue was knowing someone else was able to make this work (thanks Lucas) and seeing the error message said " It is not on the appropriate screen". I guessed that "the appropriate screen" might be the edit panel. It would be nice if the error message actually stated what panel it was talking about.

I believe that I can resolve issues like this by using a GET request to https://xxxxxx.atlassian.net/rest/api/latest/issue/GE-39/editmeta (I had been looking at the createmeta result by mistake) to get the list of fields that are available for modification via a PUT request. I'm assuming the assignee field would not have been listed until I added it as noted above, as it is now listed. I haven't tried to remove it from the edit field list to see if it goes away in the metadata result, but I'm assuming it would.

Hi Jay,

I'd just tested this same call against the same URL (https://xxxxxx.atlassian.net/rest/api/latest/issue/GE-39) but for another issue, using an OnDemand instance. I was able to assign the issue to another user. However, I'd used Postman (a Chrome extension) instead of Curl.

So, I have two concerns about it:

- Could you test with Postman?
- Are you able to assign the issue with this same user (jsacco)?

My request was:

{

"fields":{
"assignee":{"name":"xxx"}
}

}

Best regards,
Lucas Timm

Thanks for running the test. I installed Postman and tried it. I get the same result:

{

"errorMessages": [],

"errors": {

"assignee": "Field 'assignee' cannot be set. It is not on the appropriate screen, or unknown."

}

}

Sounds like there's something different about my OnDemand instance. But I don't know how to determine what it is in order to fix it. I've run createmeta on the issue and the assignee field is available so I would think it could be set in this manner. Still looking for ideas.

Hi,

I have a Similar issue, For me its working when i hit the JIRA from PostMan, However when i am posting the same JSON it from the Java code, I am getting the error ,

 

{
"errorMessages": [],
"errors": {
"description":"Field 'description' cannot be set. It is not on the appropriate screen, or unknown.",
"assignee": "Field 'assignee' cannot be set. It is not on the appropriate screen, or unknown."
}

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,209 views 13 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot