Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Jelly: get reoprter's full name

Royce Wong
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 30, 2012

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.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 30, 2012

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

&lt;JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:log="jelly:log"&gt;


  &lt;!-- Grab an instance of ComponentManager --&gt;
  &lt;core:invokeStatic className="com.atlassian.jira.component.ComponentAccessor" method="getUserUtil" var="userUtil"/&gt;
  &lt;core:invokeStatic className="com.atlassian.jira.component.ComponentAccessor" method="getIssueManager" var="issueManager"/&gt;

  &lt;!-- Get the Issue PROKEY-600  from IssueManager --&gt;
  &lt;core:invoke on="${issueManager}" method="getIssueObject" var="issue"&gt;
    &lt;core:arg type="java.lang.String" value="PROKEY-600"/&gt;
  &lt;/core:invoke&gt;
  &lt;log:warn&gt;Issue ${issue.key} found&lt;/log:warn&gt;

  &lt;!-- Get the reporter from issue --&gt;
  &lt;core:invoke on="${issue}" method="getReporter" var="reporter"/&gt;
  &lt;log:warn&gt;Reporter name: ${reporter.name}&lt;/log:warn&gt;
  &lt;log:warn&gt;Reporter full name: ${reporter.displayName}&lt;/log:warn&gt;


  &lt;!-- Get another User from UserManager by name --&gt;
  &lt;core:invoke on="${userUtil}" method="getUser" var="user"&gt;
    &lt;core:arg type="java.lang.String" value="admin"/&gt;
  &lt;/core:invoke&gt;
  &lt;log:warn&gt;Other use full name: ${user.displayName}&lt;/log:warn&gt;


&lt;/JiraJelly&gt;

Royce Wong
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 5, 2012

Thanks Dieter. The "userUtil" method worked for me!

TAGS
AUG Leaders

Atlassian Community Events