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.

5 answers

1 accepted

Accepted Answer
2 votes

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."
}

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 

0 votes

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

@Arun Thundyill Saseendran yes assignee field is available in both create and edit screen. 

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

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

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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 25, 2018 in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

465 views 7 5
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