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

Shrikant Maheshwari November 8, 2017

 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 votes
Neta Elyakim
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.
January 25, 2018

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) 
0 votes
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.
November 8, 2017

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

Shrikant Maheshwari November 9, 2017

@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.

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.
November 9, 2017

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.

0 votes
Alexey Matveev
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.
November 8, 2017

Hello,

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

Shrikant Maheshwari November 9, 2017

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

Shrikant Maheshwari November 9, 2017

@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
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.
November 9, 2017

Kindly provide your script

Suggest an answer

Log in or Sign up to answer