Not able to create issue with custom fields. For our project there are some mandatary custom fields

Here is my code -

IssueRestClient issueClient = restClient.getIssueClient();

IssueInputBuilder issueInputBuilder = new IssueInputBuilder(project, key, summary);
IssueType issueType = new IssueType(jiraServerUri, key, summary, false, "Testing creating issue REST API client", null);

BasicComponent component = new BasicComponent(jiraServerUri, 1L, "Sample-component", "abcdefgh Testing rest api");


List<ComplexIssueInputFieldValue> a1 = new ArrayList<ComplexIssueInputFieldValue>();

Map<String, Object> valuemapMap = new HashMap<String, Object>();
valuemapMap.put("id", "");

Map<String, Object> valuemap2 = new HashMap<String, Object>();
valuemapMap.put("value", a1);

ComplexIssueInputFieldValue fieldvalue = new ComplexIssueInputFieldValue(valuemap2);

issueInputBuilder.setFieldValue("customfield_14617", "Test");
issueInputBuilder.setFieldValue("customfield_15101", new ComplexIssueInputFieldValue(valuemapMap));

issueInputBuilder.setFieldValue("customfield_14623", new ComplexIssueInputFieldValue(valuemapMap));
issueInputBuilder.setFieldValue("customfield_18202", a1); 
issueInputBuilder.setFieldValue("versions", a1);


IssueInput issueInput =;

Promise<BasicIssue> promise = restClient.getIssueClient().createIssue(issueInput);




promise.isDone returns false and issue is not created in jira server. 

2 answers

0 votes
Alexey Matveev Community Champion Nov 20, 2017


You said that there are some mandatory fields for your project. Do you set values for them in your code?

Yes all the customfield_<id> are my mandatary fields and as you see in my code I am filling values for those

Alexey Matveev Community Champion Nov 20, 2017

Usually Jira returns also the exact error with the response in Json. Look at the Json returned by Jira.

This is the error i get after setting values for all customfields. Says required even after passing values to it

RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={customfield_18202=Exists On is required., versions=Affects Version/s is required., customfield_15101=Found by is required., customfield_14623=Development Stage is required.}, errorMessages=[]}]}

Does anyone have sample example code to create jira with java restcliend. by considering some of the custom_fields for particular project are mandatary. and create issue with all those fields.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,075 views 13 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot