Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Why jira rest client throws 'Issues must be assigned'?

BHUVANESWARI March 11, 2020

Hi,

 I am trying to create an issue from 

AsynchronousJiraRestClientFactory

This is my code

AsynchronousJiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();

JiraRestClient restClient = factory.create(jiraServerUri, auth);

IssueRestClient issueClient = restClient.getIssueClient();

IssueInputBuilder iib = new IssueInputBuilder();

iib.setProjectKey("PROD");

iib.setReporterName("xxxx");

iib.setSummary("test");

iib.setDescription("test describtion");

iib.setPriorityId(3L);

iib.setAssigneeName("xxx");

iib.setIssueTypeId(TASK);

 

IssueInput issue = iib.build();

 

BasicIssue issueObj = issueClient.createIssue(issue).claim();

issueId = issueObj.getKey();

Error:

RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={assignee=Issues must be assigned.}, errorMessages=[]}]}

 

Note: The assignee have permission to create an issue

this issue occurs recently (last 3 months). Before with the same set of code, created the issue.

2 answers

1 accepted

2 votes
Answer accepted
DPKJ
Community Champion
March 12, 2020

@BHUVANESWARI  The problem here is Jira Cloud has stopped taking 'name' as input for user related field in API (due to GDPR) and the library you are using 'jira-rest-java-client' is not updated to handle this.

You will need to wait for this changes to appear in library.

 

Quick Note - This library as per documentation is meant to be used with Jira Server. I suggest you call rest API directly using client like unirest.

BHUVANESWARI March 12, 2020

@DPKJ  Thanks.Make sense

0 votes
Ismael Jimoh
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 11, 2020

That’s odd. 

What value are you parsing in your assignee entry?

Can you make sure it is the user key(lower user name) that you parsed?

Also, you can consider making the assignee field optional in your field configuration and see if the error is thrown. If it isn’t then use actual user keys.

Cheers

BHUVANESWARI March 12, 2020

The code with the same case worked before @Ismael Jimoh . Even last 2 months its not get working

Himabindu Pinapala
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 21, 2023

Hello @Ismael Jimoh  How do i make assignee field optional as field configuration doesn't have an option to make the assignee field optional.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events