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

This widget could not be displayed.
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

This widget could not be displayed.

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.

This widget could not be displayed.

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 Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

226 views 3 0
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