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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Getting net.rcarz.jiraclient.RestException: 400 for multiselect custom field in Jira Edited

 am unable to create ticket when passing details of custom field. getting 400 bad request with message as mentioned below : net.rcarz.jiraclient.RestException: 400 : {"errorMessages":[],"errors":{"Customer":"expected Object"}}

Field Details:

customfield_1003={"required":true,"schema":{"type":"array","items":"option","custom":"com.atlassian.jira.plugin.system.customfieldtypes:multiselect","customId":1003},"name":"Customer","fieldId":"customfield_1003","hasDefaultValue":false,"operations":["add","set","remove"],"allowedValues":[{"self":""}]}

Tried multiple ways as bellow but no luck:

1.

            FluentCreate newIssueFluentCreate = jira.createIssue(project, issueType);
            newIssueFluentCreate.field(Field.SUMMARY, summary);
            newIssueFluentCreate.field("customfield_1003", new ArrayList<Object>() {{add(customer);}});
            newIssueFluentCreate.field(Field.DESCRIPTION, description);
            newIssueFluentCreate.field(Field.LABELS, new ArrayList<Object>() {{add(label);}});
            newIssueFluentCreate.field(Field.PRIORITY, "Minor");
            newIssue = newIssueFluentCreate.execute();
            JSONObject customerObject = new JSONObject();
            customerObject.put("value", "1225");            
            ArrayList<Object> customers = new ArrayList<>();
            customers.add(customerObject);
            
            FluentCreate newIssueFluentCreate = jira.createIssue(project, issueType);
            newIssueFluentCreate.field(Field.SUMMARY, summary);
            newIssueFluentCreate.field("customfield_1003", customers);
            newIssueFluentCreate.field(Field.DESCRIPTION, description);
            newIssueFluentCreate.field(Field.LABELS, new ArrayList<Object>() {{add(label);}});
            newIssueFluentCreate.field(Field.PRIORITY, "Minor");
            newIssue = newIssueFluentCreate.execute();

HTML for this field :

<div class="field-group">
   <label for="customfield_1003">Customer<span class="aui-icon icon-required">Required</span></label>
  <select class="select cf-select" id="customfield_1003" multiple="multiple" name="customfield_1003" size="5" data-remove-null-options="true" data-submit-input-val="true" data-input-text="">
            <option value="12306">Text1</option>
            <option value="10615">Text2</option>
            <option value="10329">Text3</option>
            <option value="1225">All</option>
            <option value="11014">Text4</option>
    </select>
</div>

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you