-
Notifications
You must be signed in to change notification settings - Fork 379
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
Checking CheckBox on customfield #71
Comments
Interesting. This might be similar to another issue someone e-mailed me about. Do you happen to know what the JSON is expected to look like? I haven't come across that field type before. |
Does this help you at all?
I got this by viewing the issue's fields in a debugger after retrieving an issue from Jira - I manually set the checkbox using the Jira web interface so that's what it should "look like" when a checkbox is checked. Thanks for the fast response on this! EDIT:
|
Yes that does help. I'll take a look soon. |
What I have found so far: I set up the same type of custom field in jira-client.atlassian.net. When you login check out https://jira-client.atlassian.net/rest/api/2/issue/JIR-1/editmeta. Field in question metadata: "customfield_10027":{"required":false,"schema":{"type":"array","items":"string","custom":"com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes","customId":10027} Schema defines array of type string and that is what we're passing. I checked. |
@chaplinkyle Did you attempt to set one of the checkboxes in the multicheckbox using jira-client? Thanks for taking the time to look into this! |
I'm not sure if the meta data I retrieved for my custom field helps in this issue or not: customfield_10025 {"required":false,"schema": "type":"array","items":"string","custom":"com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes","customId":10025},"name":"Customer Data Loss Flag","hasDefaultValue":false,"operations":["add","set","remove"],"allowedValues":[{"self":" ...server url... /jira/rest/api/2/customFieldOption/10014","value":"Yes","id":"10014"}]} |
I have managed to set checkboxes, here is how:
I'm not sure if it was designed to only work this way or if there is another way. If not then I hope what I have found helps you fix the implementation. At the least maybe now some comments can be made about how to set checkboxes with jira-client. Thanks again for the awesome tool. |
That helped a lot actually. The problem is the metadata returned by JIRA lies about what the type actually is. An array of strings (as the metadata indicates) should be an array of strings, but it's really expecting an array of dictionaries. Can you build jira-client from master and try this:
|
Hi |
I just confirmed that this worked for me. I created a custom field of type "Select List (multiple choices)" called "multiSelectTest" with custom field id "10101". The available options were "one", "two", and "three".
The String representation of 'fields' is "[{"value":"one"}, {"value":"two"}]". Hope this helps! |
Thanks for this. I actually resolved the issue by making a change to the client. I'll try and create a pull request tomorrow. |
I'm interested in knowing what wasn't working correctly with the client, I thought it was working correctly. |
Thanks for this. I actually resolved the issue by making a change to the client. I'll try and create a pull request tomorrow. Issue problem = jiraClient.getIssue("EM-8648"); JSONObject oneObject = new JSONObject(); // from import net.sf.json.JSONObject; ArrayList fields = new ArrayList(); problem.update().field("customfield_10101", fields).execute(); The String representation of 'fields' is "[{"value":"one"}, {"value":"two"}]". Hope this helps! —Reply to this email directly or view it on GitHub. |
Can you update this merged code in Maven repo? Need this API so much. Thanks. @rcarz BTW the define JSON method is not working for me. I used code from Maven 0.5 version. Returns: |
Can somebody help with this? None of the options up there work for me, I constantly get 400 400: {"errorMessages":[],"errors":{"Detected on Env":"expected Object","Country":"expected Object"}} I've added them as objects
newIssue.field("customfield_11500", new ArrayList() {{add(countryObject);}}) |
Hi, first of all thanks for creating this awesome tool!
In Jira I have a custom field that is of type Checkboxes with id = customfield_10023. The only option is "Yes" which has an id of 10013. I thought that doing what you did in the README.md file, for multi-select boxes, would work, but I can't seem to get it to. Is it not supported or is there a different way to set check boxes? Thank you very much.
Both ways I get the following error:
The text was updated successfully, but these errors were encountered: