Jira REST Java Client Exception since Mid February 2020

wwerner
Contributor
February 17, 2020

We have several tools that do communicate with JIRA Software (CLOUD) via Java Rest API.

Since some days we cannot communicate any longer - several JIRA REST cals do fail in an (JIRA REST CLIENT) internal processing of the delivered results. 

E.G. a user name is no longer transferred (only display name). 

Any clues?

RestClientException{statusCode=Optional.absent(), errorCollections=[]}

 

5 answers

2 accepted

0 votes
Answer accepted
wwerner
Contributor
February 19, 2020
0 votes
Answer accepted
wwerner
Contributor
February 18, 2020

I copied the class JsonParseUtil from jira-rest-java-client-core-5.1.6 and modified the function parsebasicUser to this:

@Nullable
public static BasicUser parseBasicUser(@Nullable final JSONObject json) throws JSONException {
if (json == null) {
return null;
}

final String username = json.optString("name", null);
if (!json.has(JsonParseUtil.SELF_ATTR) && "Anonymous".equals(username)) {
return null; // insane representation for unassigned user - JRADEV-4262
}

// deleted user? BUG in REST API: JRA-30263
final URI selfUri = optSelfUri(json, BasicUser.INCOMPLETE_URI);
return new BasicUser(selfUri, username, json.optString("displayName", null));
}

With this, my program runs fine.

1 vote
Giuliano C_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 17, 2020

Heya @wwerner,

I will share my answer on the related thread. I hope it helps you:

As part of the European General Data Protection Regulation (GDPR), usernames have been deprecated from API calls and those will be identified by their Atlassian account ID (accountId), instead. This change has been announced in 2018 and had some reminders with some useful information:

https://confluence.atlassian.com/cloud/blog/2018/06/say-goodbye-to-usernames-in-atlassian-cloud

https://community.developer.atlassian.com/t/announcement-reminder-on-removal-of-user-names/34111

Lastly, you can refer to our guide that shows you how to update the call, including the resources that required parameters like usernames.

 Feel free to get in touch with the support team or anyone else, if you feel that there is anything we can do there. :)

Cheers,

Giu

wwerner
Contributor
February 18, 2020

Hi @Giuliano C_ thanks for your answer, this is exactly the same case and as   pointed out in the related thread by @ruel_loehr, this seams to be an error in the java rest client library. Is there any information on that part? The error is not caused by my code to access the old name, it is forced by the internal processing of the delivered result from jira cloud.

This breaks our complete bill processing which is based on worklogs. The internal code (Atlassian provided) works with a BasicUser Object that in my view does not mirror the GDPR changes.

Please help! Thank you again.

0 votes
Robot User February 20, 2020

Saved my bacon, thanks. I built my own library with the modifed JsonParseUtils.java with username set to "" and suddenly getIssue started working again .

0 votes
App_Umane
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 17, 2020

I'm having the same issue, please check this topic

 

https://community.atlassian.com/t5/Jira-questions/JIRA-REST-API-missing-parameters/qaq-p/1302944#M408883

 

Regards

Victor anonymous Programmer

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events