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!
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
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this:
str(issue.raw['fields']['assignee']['emailAddress']
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.