@Override public IssueType createIssueType(GenericValue issueTypeGv) { final IssueTypeImpl issueType = new IssueTypeImpl(issueTypeGv, translationManager, authenticationContext, baseUrl, avatarManager); final Avatar avatar = issueType.getAvatar(); if (avatar != null) { // dirty trick to update iconURL to this in avatar // this shouldn't be here but somewhere in presentation layer where i should transform it to link // (and apply user permissions - thankfully its not needed for issue types). // I cannot inject UniversalAvatars here beacause there is circular dependecy project->issue+types->avatars->project. // if i could put such code to presentation layer it would be possible. of course because of backward compatibility final UniversalAvatarsService universalAvatars = ComponentAccessor.getComponent(UniversalAvatarsService.class); final AvatarImageResolver uriForIssueType = universalAvatars.getImages(Avatar.Type.ISSUETYPE); final URI avatarURI = uriForIssueType.getAvatarRelativeUri(null, avatar, Avatar.Size.SMALL); final String avatarURIString = avatarURI.toASCIIString(); issueType.setIconUrl(avatarURIString); } return issueType; }