Automation: Cannot access custom user picker field .emailAddress value

david-urban April 11, 2021

I am trying to send an email after issue transition to notify QA people to perform a test. Person responsible for it is marked it a custom "People" user-picker. I am limiting it to a single user. Project is "Team-managed", no extensions or plugins are in use.

While listing REST API json object for the issue, I see fields.customfield_100xx.emailAddress, but when I try to use it as either the recipient of the email or in simple Log test action it is empty. If I log the {{customfield_100xx}} object, it displays everything (name, avatar, id, …) but not the emailAddress. Displaying any other values (like .name) work fine. 

I have tried: {{issue.fields.customfield_100xx.emailAddress}}, {{fields.customfield_100xx.emailAddress}}, {{customfield_100xx.emailAddress}}, {{Field Name.emailAddress}} and few others (like {{Field Name}}{{emailAddress}} {{/}}, which does not pass validation while saving the rule). 

I smell a bug, but since I cannot find a report anywhere and no documentation handling this, I'd like to ask before I report it… Does anyone know what I am missing?

2 answers

0 votes
Alexander Zeh June 19, 2023

I have exactely the same problem right now. Did you get any solution back then?

david-urban June 19, 2023

Hi Alex, as a matter of fact I did – It is a bug in JIRA and they are tracking it as: https://codebarrel.atlassian.net/browse/AUT-1651 (internal). So it may or may not come in some future release. 

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 11, 2021

Hi David,

Are you sure it is the same field? Custom fields in Team managed projects will not show in the Issues > Custom Fields list. You might be seeing a different field with the same name.

The other thing to try is all lowercase in your field name code - I have seen that work before.

david-urban April 12, 2021

Dear John,

thank you for lowercase suggestion, I tried, sady it did not help. Here is a piece of JSON API I took the info from:

Screen Shot 2021-04-12 at 9.19.11.png

It clearly is the field I am looking for. Could you maybe try on your instance? Just to confirm?

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 12, 2021

The image came in a little big so I am not able to see all of the code. 

david-urban April 12, 2021

Here is the full JSON, I made a screenshot of only the important part. I need email address of person save I’d field “Quality Assistance”:

{"expand":"renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations","id":"12342","self":"https://racom-jira.atlassian.net/rest/api/2/issue/12342","key":"RA2H-36","names":{"statuscategorychangedate":"Status Category Changed","issuetype":"Issue Type","timespent":"Time Spent","project":"Project","fixVersions":"Fix versions","aggregatetimespent":"Σ Time Spent","resolution":"Resolution","resolutiondate":"Resolved","workratio":"Work Ratio","lastViewed":"Last Viewed","issuerestriction":"Restrict to","watches":"Watchers","customfield_10060":"Location","created":"Created","customfield_10020":"Sprint","customfield_10021":"Flagged","customfield_10022":"Target start","customfield_10023":"Target end","priority":"Priority","customfield_10024":"[CHART] Date of First Response","customfield_10025":"[CHART] Time in Status","labels":"Labels","customfield_10016":"Story point estimate","customfield_10017":"Issue color","customfield_10018":"Parent Link","customfield_10019":"Rank","timeestimate":"Remaining Estimate","aggregatetimeoriginalestimate":"Σ Original Estimate","versions":"Affects versions","issuelinks":"Linked Issues","assignee":"Assignee","updated":"Updated","status":"Status","components":"Components","customfield_10050":"Component","timeoriginalestimate":"Original estimate","description":"Description","customfield_10010":"Request Type","customfield_10056":"Hiring manager","customfield_10057":"Job role","customfield_10014":"Epic Link","customfield_10058":"Department","customfield_10015":"Start date","timetracking":"Time tracking","customfield_10059":"Date of hire","customfield_10005":"Change type","customfield_10006":"Change risk","security":"Security Level","customfield_10007":"Change reason","customfield_10008":"Change start date","aggregatetimeestimate":"Σ Remaining Estimate","customfield_10009":"Change completion date","attachment":"Attachment","summary":"Summary","creator":"Creator","subtasks":"Sub-tasks","reporter":"Reporter","aggregateprogress":"Σ Progress","customfield_10000":"Development","customfield_10001":"Team","customfield_10002":"Organizations","customfield_10003":"Approvers","customfield_10004":"Impact","customfield_10048":"Quality Assistance","environment":"Environment","duedate":"Due date","progress":"Progress","votes":"Votes","comment":"Comment","worklog":"Log Work"},"fields":{"statuscategorychangedate":"2021-04-12T09:07:51.020+0200","issuetype":{"self":"https://racom-jira.atlassian.net/rest/api/2/issuetype/10127","id":"10127","description":"A problem or error.","iconUrl":"https://racom-jira.atlassian.net/secure/viewavatar?size=medium&avatarId=10303&avatarType=issuetype","name":"Bug","subtask":false,"avatarId":10303,"entityId":"364d2a68-8653-492f-b944-b479fab8035d","hierarchyLevel":0},"timespent":null,"project":{"self":"https://racom-jira.atlassian.net/rest/api/2/project/10038","id":"10038","key":"RA2H","name":"HW RipEX2-H","projectTypeKey":"software","simplified":true,"avatarUrls":{"48x48":"https://racom-jira.atlassian.net/secure/projectavatar?pid=10038&avatarId=10419","24x24":"https://racom-jira.atlassian.net/secure/projectavatar?size=small&s=small&pid=10038&avatarId=10419","16x16":"https://racom-jira.atlassian.net/secure/projectavatar?size=xsmall&s=xsmall&pid=10038&avatarId=10419","32x32":"https://racom-jira.atlassian.net/secure/projectavatar?size=medium&s=medium&pid=10038&avatarId=10419"},"projectCategory":{"self":"https://racom-jira.atlassian.net/rest/api/2/projectCategory/10001","id":"10001","description":"","name":"Projekty"}},"fixVersions":[],"aggregatetimespent":null,"resolution":{"self":"https://racom-jira.atlassian.net/rest/api/2/resolution/10000","id":"10000","description":"Work has been completed on this issue.","name":"Done"},"resolutiondate":"2021-04-12T09:07:51.015+0200","workratio":-1,"lastViewed":"2021-04-12T10:34:32.458+0200","issuerestriction":{"issuerestrictions":{},"shouldDisplay":true},"watches":{"self":"https://racom-jira.atlassian.net/rest/api/2/issue/RA2H-36/watchers","watchCount":1,"isWatching":true},"customfield_10060":null,"created":"2021-04-11T10:15:33.623+0200","customfield_10020":null,"customfield_10021":null,"customfield_10022":null,"customfield_10023":null,"priority":{"self":"https://racom-jira.atlassian.net/rest/api/2/priority/3","iconUrl":"https://racom-jira.atlassian.net/images/icons/priorities/medium.svg","name":"Medium","id":"3"},"customfield_10024":null,"customfield_10025":"10118_*:*_4_*:*_549294_*|*_10117_*:*_1_*:*_17585_*|*_10119_*:*_1_*:*_0_*|*_10126_*:*_4_*:*_81770546","labels":[],"customfield_10016":null,"customfield_10017":null,"customfield_10018":{"hasEpicLinkFieldDependency":false,"showField":false,"nonEditableReason":{"reason":"PLUGIN_LICENSE_ERROR","message":"The Parent Link is only available to Jira Premium users."}},"customfield_10019":"0|i00lyp:","timeestimate":null,"aggregatetimeoriginalestimate":null,"versions":[],"issuelinks":[],"assignee":{"self":"https://racom-jira.atlassian.net/rest/api/2/user?accountId=557058%3Ab72e8101-b8ad-441a-8ecd-029d2c50f0b8","accountId":"557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8","emailAddress":"david.urban@hey.com","avatarUrls":{"48x48":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8/eb99130b-afed-4b4f-bb10-9b176eb40852/48","24x24":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8/eb99130b-afed-4b4f-bb10-9b176eb40852/24","16x16":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8/eb99130b-afed-4b4f-bb10-9b176eb40852/16","32x32":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8/eb99130b-afed-4b4f-bb10-9b176eb40852/32"},"displayName":"David Urban","active":true,"timeZone":"Europe/Prague","accountType":"atlassian"},"updated":"2021-04-12T09:07:51.248+0200","status":{"self":"https://racom-jira.atlassian.net/rest/api/2/status/10119","description":"","iconUrl":"https://racom-jira.atlassian.net/","name":"Done","id":"10119","statusCategory":{"self":"https://racom-jira.atlassian.net/rest/api/2/statuscategory/3","id":3,"key":"done","colorName":"green","name":"Done"}},"components":[],"customfield_10050":null,"timeoriginalestimate":null,"description":null,"customfield_10010":null,"customfield_10056":null,"customfield_10057":null,"customfield_10014":null,"customfield_10058":null,"customfield_10015":null,"timetracking":{},"customfield_10059":null,"customfield_10005":null,"customfield_10006":null,"security":null,"customfield_10007":null,"customfield_10008":null,"aggregatetimeestimate":null,"customfield_10009":null,"attachment":[],"summary":"TEST issue","creator":{"self":"https://racom-jira.atlassian.net/rest/api/2/user?accountId=557058%3Ab72e8101-b8ad-441a-8ecd-029d2c50f0b8","accountId":"557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8","emailAddress":"david.urban@hey.com","avatarUrls":{"48x48":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8/eb99130b-afed-4b4f-bb10-9b176eb40852/48","24x24":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8/eb99130b-afed-4b4f-bb10-9b176eb40852/24","16x16":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8/eb99130b-afed-4b4f-bb10-9b176eb40852/16","32x32":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8/eb99130b-afed-4b4f-bb10-9b176eb40852/32"},"displayName":"David Urban","active":true,"timeZone":"Europe/Prague","accountType":"atlassian"},"subtasks":[],"reporter":{"self":"https://racom-jira.atlassian.net/rest/api/2/user?accountId=557058%3Ab72e8101-b8ad-441a-8ecd-029d2c50f0b8","accountId":"557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8","emailAddress":"david.urban@hey.com","avatarUrls":{"48x48":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8/eb99130b-afed-4b4f-bb10-9b176eb40852/48","24x24":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8/eb99130b-afed-4b4f-bb10-9b176eb40852/24","16x16":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8/eb99130b-afed-4b4f-bb10-9b176eb40852/16","32x32":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8/eb99130b-afed-4b4f-bb10-9b176eb40852/32"},"displayName":"David Urban","active":true,"timeZone":"Europe/Prague","accountType":"atlassian"},"aggregateprogress":{"progress":0,"total":0},"customfield_10000":"{}","customfield_10001":null,"customfield_10002":null,"customfield_10003":null,"customfield_10004":null,"customfield_10048":[{"self":"https://racom-jira.atlassian.net/rest/api/2/user?accountId=557058%3Ab72e8101-b8ad-441a-8ecd-029d2c50f0b8","accountId":"557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8","emailAddress":"david.urban@hey.com","avatarUrls":{"48x48":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8/eb99130b-afed-4b4f-bb10-9b176eb40852/48","24x24":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8/eb99130b-afed-4b4f-bb10-9b176eb40852/24","16x16":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8/eb99130b-afed-4b4f-bb10-9b176eb40852/16","32x32":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:b72e8101-b8ad-441a-8ecd-029d2c50f0b8/eb99130b-afed-4b4f-bb10-9b176eb40852/32"},"displayName":"David Urban","active":true,"timeZone":"Europe/Prague","accountType":"atlassian"}],"environment":null,"duedate":null,"progress":{"progress":0,"total":0},"votes":{"self":"https://racom-jira.atlassian.net/rest/api/2/issue/RA2H-36/votes","votes":0,"hasVoted":false},"comment":{"comments":[],"self":"https://racom-jira.atlassian.net/rest/api/2/issue/12342/comment","maxResults":0,"total":0,"startAt":0},"worklog":{"startAt":0,"maxResults":20,"total":0,"worklogs":[]}}}
Bill Sheboy
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 12, 2021

Hi @david-urban 

Please try this one: {{issue.customfield_10048.emailAddress.value}}

I have seen a few posts where the custom fields required the use of "value".

And if that does not help, would you please post an image of your complete rule and audit log from an execution? That may provide some context for the community to offer ideas.  Thanks!

Best regards,

Bill

david-urban April 13, 2021

Thank for suggestion Bill, sadly it still does not work. Here is the test Rule I use to display email in log:

Screen Shot 2021-04-13 at 20.19.08.png

And log result:

Screen Shot 2021-04-13 at 20.17.17.png

As you see, email does not get logged.

If I log the whole object {{customfield_10048}}, here is the result:

Screen Shot 2021-04-13 at 20.20.18.png

Even though email gets displayed in JSON API, it is not displayed in Rules… I have no idea why. 

I appreciate all you help! 

Bill Sheboy
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 13, 2021

Hi @david-urban 

Smart values are case-sensitive, so please try that again with emailAddress.  Thanks!

__Bill

Like John Funk likes this
david-urban April 16, 2021

Thank you for the suggestion, it still does not work. :( 

Bill Sheboy
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 16, 2021

Thanks, David.  Just to confirm, neither of these work, correct?

  • {{issue.customfield_10048.emailAddress}}
  • {{issue.customfield_10048.emailAddress.value}}

Is this a Team-Managed (formerly called Next-Gen) project?  If so there appears to be an open defect for the User Picker field access to the emailAddress attribute with automation:

https://codebarrel.atlassian.net/browse/AUT-1830

Like John Funk likes this
david-urban April 19, 2021

Yes, neither works and yes it is a Team-managed project. Sadly, it does not seem there is much traction in the issue. I have launched support request with Atlassian since this clearly in now confirmed as a bug. 

Thank you all for your help!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events