Hello, I would like to understand if (and how) it's possibile to retrieve the user's emailAddress from {[fieldChange}}
My need is the following: on "repoter" field change I need to extratc previous and new user's email.
I used {{fieldChange}} and printed it with Log action
FieldChange = ChangeItemBean{fieldId='reporter', field='reporter', fieldType='null', from='60c5fc79758a5d006aa0048e', fromString='Angelo Locritani - Gmail', to='60c5fed5deecef006a292826', toString='Angelo Locritani'}
Normally I'm able to use {{reporter.emailAddress}} to retrieve the needed info (and it also works for the new reporter after updating the field), but how to retrieve the old reporter's email address?
I thought {{fieldChange.from.emailAddress}} would work, but no, it returns empty string because {{fieldChange.from}} returns the user's id, not an user "object"
is there a way to "cast" fieldChange value to user object so I can use .emailAddress ?
Welcome to the community.
No this is not possible.
But based on the accountId retrieved, you could execute a web request action, to api endpoint.
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-get
from the response of the call you can get the email address.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.