When I try to create an issue
issueClient.createIssue(newIssue.build()).claim().getKey();
I get
org.codehaus.jettison.json.JSONException: A JSONObject text must begin with '{' at character
How can I deal with that?
The error seems to be clear. You are sending a wrong data object to that API. The JSON object isn't formatted properly. You need to get that checked.
I send via postaman:
and as IssueInput I get:
IssueInput{fields={summary=FieldInput{id=summary, value=REST ye merry gentlemen.}, issuetype=FieldInput{id=issuetype, value=ComplexIssueInputFieldValue{valuesMap={id=1}}}, project=FieldInput{id=project, value=ComplexIssueInputFieldValue{valuesMap={key=TEST}}}}}
when I execute
issueClient.createIssue(input).claim().getKey();
I get:
org.codehaus.jettison.json.JSONException: A JSONObject text must begin with '{' at character 1 of <?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>404</status-code><message>null for uri: https://ocadotech.atlassian.net/rest/api/3/rest/api/latest/issue</message></status>
I do think I have correct json, but if I'm wrong please correct me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your JSON data seems valid, I'm not sure what might be wrong here. If you're sending via postman probably you want to confirm that the URL you're sending to is actually the right one and also if there's any additional data that is being passed along with your request via the postman.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Emilia Traczyk , I am also facing same issue...could you please share the solution?
How did you get it working?
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.