Hi all,
In JIRA 4.4.5. how do I get reporter's full name (a.k.a. DiaplyName) in Jelly script? Is there a WORKING example?
The old <core:invokeStatic className="com.opensymphony.user.UserManager" method="getInstance" var="UserManagerInstance"></core:invokeStatic> doesn't work anymore.
I think I should use com.atlassian.crowd.embedded.core.util.StaticCrowdServiceFactory but having a hard time getting it to work.
Thanks in advance.
Community moderators have prevented the ability to post new answers.
The following works in 4.4.5 and gets the reporter display name from an issue's key. It also shows how to get the user object from an user name
<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:log="jelly:log"> <!-- Grab an instance of ComponentManager --> <core:invokeStatic className="com.atlassian.jira.component.ComponentAccessor" method="getUserUtil" var="userUtil"/> <core:invokeStatic className="com.atlassian.jira.component.ComponentAccessor" method="getIssueManager" var="issueManager"/> <!-- Get the Issue PROKEY-600 from IssueManager --> <core:invoke on="${issueManager}" method="getIssueObject" var="issue"> <core:arg type="java.lang.String" value="PROKEY-600"/> </core:invoke> <log:warn>Issue ${issue.key} found</log:warn> <!-- Get the reporter from issue --> <core:invoke on="${issue}" method="getReporter" var="reporter"/> <log:warn>Reporter name: ${reporter.name}</log:warn> <log:warn>Reporter full name: ${reporter.displayName}</log:warn> <!-- Get another User from UserManager by name --> <core:invoke on="${userUtil}" method="getUser" var="user"> <core:arg type="java.lang.String" value="admin"/> </core:invoke> <log:warn>Other use full name: ${user.displayName}</log:warn> </JiraJelly>
Thanks Dieter. The "userUtil" method worked for me!
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.