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=[]}
The solution is to patch the class, preferably by merging this:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Saved my bacon, thanks. I built my own library with the modifed JsonParseUtils.java with username set to "" and suddenly getIssue started working again .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm having the same issue, please check this topic
Regards
Victor anonymous Programmer
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.