Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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

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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 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.

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

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!
Sep 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