Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Assignee's Email Address Lookup

Khanh Nguyen
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.
January 19, 2012

Is there a way to look up the Assignee's Email address from LDAP and place this value in a custom field?

Example of use: I would like to ultimately get a listing of all assignee's Email addresses of issues that are overdued. If I can do this somehow by using a filter, that would be excellent.

Thanks!

2 answers

1 accepted

0 votes
Answer accepted
tier-0 grump
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 21, 2012

The good news is you don't need to look it up, email addresses are a property of JIRA users - so you can just get this value in your custom field. See some sample code here for a text custom field for instance

atlassian-plugin.xml

 <customfield-type key="readonly-assignee" name="Read Only Assignee email CF"
                      class="com.atlassian.jira.issue.customfields.impl.ReadOnlyCFType">
        <description>Read Only Assignee CF Description</description>
        <resource type="velocity" name="view" location="templates/view-readonly-assignee.vm"/>
        <resource type="velocity" name="column-view" location="templates/view-readonly-assignee.vm"/>
        <resource type="velocity" name="xml" location="templates/view-readonly-assignee.vm"/>
        <resource type="velocity" name="edit" location="templates/view-readonly-assignee.vm"/>
    </customfield-type>

Then you can create the template view-readonly-assignee.vm

Assignee email : $!issue.assigneeUser.emailAddress

Khanh Nguyen
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.
January 22, 2012

Thanks James,

We'll definitely check in to that. . . Just wondering if there's an official or unofficial listing of fields that are already 'a property of JIRA users' that we can leverage this same procedure to expose as custom fields.

Can we do the same for Reporter's Email address?

Best regards!

tier-0 grump
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 23, 2012

Not easily available - however the API docs are here - http://docs.atlassian.com/software/jira/docs/api/latest/ and if you flook up th Issue class you'l find it has a getAssigneeUser method, unfortunately this doesn't expand on the user object thsi returns as we get this from Crowd, so you'd struggle to find the fact easily that User has a getEmailAdress method. The second part of the puzzle is knowing that issue is available as a vm parameter that you can query - to see a list of commonly available context parameters you can head to https://developer.atlassian.com/display/JIRADEV/Contents+of+the+Velocity+Context - this shows me I can get hold of the current issue using $issue. And as reporter is a user, you can do $issue.reporterUser.emailAddress - in this case you don't need the ! as getReporterUser() can never return null.

0 votes
bikram.biswas
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 2, 2019

Try this:

str(issue.raw['fields']['assignee']['emailAddress']

Michael Stella July 9, 2019

That doesn't seem to be set all of the time.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events