We have created an e-mail template in jira.
Is there a way to have the repoter/assignee (or custom field (pick user)) show the email address of the user and not the username?
(Jira on Premise)
assuming they are not batched notifications (they work a bit different) it should be possible - however, I have no ready-solution but probably something you could investigate further.
Judging by the path you mentioned I believe you are not using batched notification so the following could be a start.
I read here: https://community.atlassian.com/t5/Answers-Developer-Questions/How-do-I-display-the-full-name-of-a-user-picker-custom-field-in/qaq-p/491290
about an example: ($issue.getCustomFieldValue("customfield_10094").name)
It could work - when the value "name" is replaced by the matching part for e-mail. Just a guess: you could try something similar with .email or probably .emailAddress (in Community there can be found information that the one or another worked in the past - however, I suspect there were additional Apps involved, why it might be it will not work for you, unfortunately).
Of course, please adapt the said above to your template.
If it does not work a solution could probably be to fetch the mail address with some kind of scripting solution and put it to a dedicated custom field of type "email". This should be easier to access via Velocity templates. However, I recognize this would require an App and you have not stated if you have one in your instance (probably not willing to pay another one) - also, it would be a quite hacky way.
Would be interested in what you find out!
i tried again, and now it works.
i used: (user picker customfield)
my whole customfield.vm looks like:
#set ($customfield = $customFieldManager.getCustomFieldObject("customfield_10200"))
if you would like to show the whole username:
#set ($customfield = $customFieldManager.getCustomFieldObject("customfield_10201"))
im not a developer, so there can be some mistakes, use at your own risk :)
You can edit the template files on server level, but i'm not sure that you can implement this specific thing.
I never did i myself and i always recommend customers not to edit those as this would mean that with every upgrade you need to modify all the templates again.
Thank you for your response.
I edited the templates here :
Till now, i was not able to create a custom field (pick user) with e-Mail address.
Is there any code or script which can be added to the custom-filed (customfield.vm) with that i can catch the e-mail address of a user?
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events