while using the script runner post function getting the error message-

 Bad Requestbody: [errorMessages:[], errors:[assignee:Field 'assignee' cannot be set. It is not on the appropriate screen, or unknown.]]2017-11-08 08:30:26.864 ERROR - Please use the ScriptRunner user to complete this task not the Initiating User.

 

 body: [errorMessages:[], errors:[assignee:User 'Paul Davis' does not exist.]]

3 answers

0 vote
Alexey Matveev Community Champion Nov 08, 2017

Hello,

Check that assignee field is on the screen and you have assign issue permission.

The Asignee field is already there on the sceen and i can change the assignee field still getting the error message.

@Alexey Matveev

 

The Asignee field is already there on the sceen and i can change the assignee field still getting the error message.

Alexey Matveev Community Champion Nov 09, 2017

Kindly provide your script

0 vote

You'll need to explain where you are seeing this and what you're doing to provoke it.

@Nic Brough [Adaptavist]

I have impelmented the script runner and updating the assignee at 2 different transitions of the workflow -

one is at the issue creation where getting the error message as -

2017-11-09 09:55:34.139 WARN - PUT request to /rest/api/2/issue/150226 returned an error code: status: 400 - Bad Request
body: [errorMessages:[], errors:[assignee:User 'Andreas, Elise C' does not exist.]]

But the user is present .












 Second at the time of validation getting the error message as -

body: [errorMessages:[], errors:[assignee:Field 'assignee' cannot be set. It is not on the appropriate screen, or unknown.]] 2017-11-09 09:56:43.972 ERROR - Please use the ScriptRunner user to complete this task not the Initiating User. See https://docs.atlassian.com/jira/REST/cloud/#api/2/issue-editIssue for more information. If you are using the ScriptRunner user then check the Field Configuration

But the assignee field is present at the issue screen and is editable also.

That error message can be a little misleading.  Technically, it is probably right - the field does not appear on the screen, but it's not because the field is not included in the screen, it's because the user you have logged in as does not have "assign issue" permission.  That hides the field from them, hence the "field not on screen" being correct, but not telling you the actual problem.

First, check if this user is an active user.

Second, the assignee field need to appear in the view, create and edit screen.

Finally, check if you have defined the assignee in the script like that:

def result = put('/rest/api/2/issue/'+issue.key)       
.header('Content-Type', 'application/json')        
.body([                
fields: [                        
 assignee   : [                                
name: "user_name"
   ]               
]        
])        
.asObject(Map) 

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