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.

3 answers

1 accepted

1 vote
Answer accepted
Maud Schlich
Contributor
October 13, 2014

Hello,

to compare two values you need to use == instead of =

<!-- @@Formula: Integer i = issue.get("customfield_10303").intValue ();

if (i==null) return null;

if (i==1) return "one";

if (i==2) return "two";

-->

Stas
October 13, 2014

YES!! Thats works!!))) THANKS!!!!

Maud Schlich
Contributor
October 13, 2014

Great.

0 votes
Stanislav Ryzhov
September 14, 2014

Can anyone please help me with this problrm?

0 votes
Mike at Black Pearl
September 12, 2014

what data type is issue.get("customfiled_10303)? I bet is String.

 

Try adding quotes around "1" and "2".

 

Mike Hester BlackpearlPdm

Stanislav Ryzhov
September 12, 2014

data type? Just custom number field. quotes not working. <!-- @@Formula: if issue.get("customfield_10303").intValue = "1" return "one" -->

Stanislav Ryzhov
September 12, 2014

<!-- @@Formula: if (issue.get("customfield_10303").intValue()) = "1" return "one" --> not working either <!-- @@Formula: (issue.get("customfield_10303").intValue()) --> works good, but i need "if" cascade

Suggest an answer

Log in or Sign up to answer