Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to create ticket if fields is multiselect - getting net.rcarz.jiraclient.RestException: 400 : {"errorMessages":[],"errors":{"Customer":"expected Object"}} #287

Open
pankajpkm opened this issue Jul 2, 2021 · 0 comments

Comments

@pankajpkm
Copy link

Custom Field in Jira :
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":""}]}

Options tried:
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();

Please check out the complete description in stack overflow :
https://stackoverflow.com/q/68222538/3863306

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant