Jira REST change assignee example doesn't work

Deleted user April 9, 2013

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.

5 answers

1 accepted

2 votes
Answer accepted
Deleted user April 9, 2013

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.

0 votes
restapi May 17, 2018

I want to update Automation Status field for a Issue type as Test Case using Rest Api.

I am using below url

screens/15300/availableFields

On UI for all 3 screens, Create/Edit/View automation status field is visible but when I do GET of above url, automation status field is not retrieved.

0 votes
restapi May 16, 2018

I am getting below error when i try to update the status of issue using Rest Api

 

"resolution":"Field 'resolution' 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."}}"

 

i am doing PUT on /rest/api/2/issue/issue_id

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 16, 2018

Either check the transition screen has those two field, or stop trying to set them in the call to make the transition.

0 votes
Arun_Thundyill_Saseendran
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.
March 9, 2018

@ArunKumar Santh and @Kavitha Yeleti could you please check whether the fields that you are trying to set are in the edit/create screen?

Kavitha Yeleti March 12, 2018

@[deleted] yes assignee field is available in both create and edit screen. 

0 votes
LucasA
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.
April 9, 2013

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

Deleted user April 9, 2013

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.

ArunKumar Santhana August 2, 2016

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."
}
Kavitha Yeleti March 9, 2018

Hey,

am also getting the same error while setting an assignee from client side through rest api,while it worked fine from PostMan. and i checked in my jira that i have permissions to assign issues and can be an assignee too, and my assignee field is available in create screen as well.

If any one knows the answer please let me know. Thanks!

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

Regards,

Kavitha 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events