private static void addNonRenderableData(WorklogJsonBean bean, final Worklog log, final JiraBaseUrls baseUrls, final UserManager userManager, final ApplicationUser loggedInUser, final EmailFormatter emailFormatter) { try { bean.self = new URI(baseUrls.restApi2BaseUrl() + "issue/" + log.getIssue().getId().toString() + "/worklog/" + log.getId().toString()); } catch (URISyntaxException e) { throw new RuntimeException("Failed to generate worklog self url", e); } bean.author = getUserBean(baseUrls, log.getAuthor(), userManager, loggedInUser, emailFormatter); bean.updateAuthor = getUserBean(baseUrls, log.getUpdateAuthor(), userManager, loggedInUser, emailFormatter); bean.id = Long.toString(log.getId()); final String groupLevel = log.getGroupLevel(); final ProjectRole roleLevel = log.getRoleLevel(); if (groupLevel != null) { bean.visibility = new VisibilityJsonBean(VisibilityJsonBean.VisibilityType.group, groupLevel); } else if (roleLevel != null) { bean.visibility = new VisibilityJsonBean(VisibilityJsonBean.VisibilityType.role, roleLevel.getName()); } }