As Part of GDPR the Jira UserParsing fails when no name found

gdpr
rest-api

#1

Hello,
I am trying to prepare our code to be GDPR compliant ( [https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/)) . I am doing this by passing the request header with
x-atlassian-force-account-id = true . But when I do that the Json Object parsing breaks, with the below error stack trace.
The User object does not return the name property and the com.atlassian.jira.rest.client.internal.json.UserJsonParser.java still looks for it breaking the parsing.
I tried this with jira-rest-client-core*.jar with 3.0.0, 4.0.0 and 5.1.0 versions and fails for every one of them.
Can anyone help me with this.
This is on the searchI ssues rest API call
[https://XXX-platform.atlassian.net//rest/api/latest/search?jql=project+%3D+%27XXX%27+order+by+id&expand=schema,names&fields=-attachment,*all&maxResults=1&startAt=0](https://xxx-platform.atlassian.net//rest/api/latest/search?jql=project+%3D+%27XXX%27+order+by+id&expand=schema,names&fields=-attachment,*all&maxResults=1&startAt=0)

"throwable":"org.codehaus.jettison.json.JSONException: JSONObject[\"name\"] not found.\n\tat org.codehaus.jettison.json.JSONObject.get(JSONObject.java:360)\n\tat org.codehaus.jettison.json.JSONObject.getString(JSONObject.java:487)\n\tat com.atlassian.jira.rest.client.internal.json.JsonParseUtil.parseBasicUser(JsonParseUtil.java:192)\n\tat com.atlassian.jira.rest.client.internal.json.UserJsonParser.parse(UserJsonParser.java:34)\n\tat com.atlassian.jira.rest.client.internal.json.UserJsonParser.parse(UserJsonParser.java:31)\n\tat com.atlassian.jira.rest.client.internal.json.IssueJsonParser.getOptionalNestedField(IssueJsonParser.java:300)\n\tat com.atlassian.jira.rest.client.internal.json.IssueJsonParser.parse(IssueJsonParser.java:235)\n\tat com.atlassian.jira.rest.client.internal.json.IssueJsonParser.parse(IssueJsonParser.java:88)\n\tat com.atlassian.jira.rest.client.internal.json.GenericJsonArrayParser.parse(GenericJsonArrayParser.java:39)\n\tat com.atlassian.jira.rest.client.internal.json.SearchResultJsonParser.parse(SearchResultJsonParser.java:40)\n\tat com.atlassian.jira.rest.client.internal.json.SearchResultJsonParser.parse(SearchResultJsonParser.java:27)\n\tat ```

Thanks and Regards
Deepa

#2

It looks like you might be using a jar file that works with Jira server. The Jira server and cloud APIs are not the same, so I wouldn’t expect that jar to work with cloud.


#3

Hi Bkelley,
Thanks for your reply. So can you please tell me what jar should i be using for cloud then?
And i assume the GDPR changes are affecting only JIRA cloud.
So is there no common jar that we can use for both server and cloud apis?
Thanks and Regards
Deepa


#4

Hi. Sorry, but Jira Cloud does not provide a Java API for calling REST endpoints.
The Jira Server jar cannot be used for Cloud. While many APIs are similar, many are different.