How to get reporter email using REST API

Marcelo Mella March 26, 2024

I have a Service Desk configured to receive tickets from 2 different companies
acmecorp.com and acmeinc.com. They have different SLA.
I need to differentiate users from one company and the other, but i can't access email information to see the domain that the user belongs.
Any workaround?

1 answer

0 votes
Kseniia Trushnikova
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 3, 2024

Hi @Marcelo Mella,

Try this:

https://yoursite.atlassian.net/rest/api/3/issue/<ISSUEKEY-12345>?fields=reporter

This request will return the emailAddress attribute as well as other reporter's properties: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get

Marcelo Mella April 3, 2024

Thanks for the suggestion Kseniia, but the response doesn't include emailAddress

 

{
"expand":"renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations",
"id":"10000",
"self":"xxx",
"key":"xxx",
"fields":{
"reporter":{
"self":"xxx",
"accountId":"xxx",
"avatarUrls":{
"48x48":"xxx.png",
"24x24":"xxx.png",
"16x16":"xxx.png",
"32x32":"xxx.png"
},
"displayName":"Marcelo Mella",
"active":true,
"timeZone":"America/Santiago",
"accountType":"atlassian"
}
}
Kseniia Trushnikova
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 3, 2024

@Marcelo Mella, sorry for misleading you. I checked this API request and got my email back:

{
  "expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations",
  "id": "10000",
  "self": "https://xxx.atlassian.net/rest/api/latest/issue/10000",
  "key": "SUP-1",
  "fields": {
    "reporter": {
      "self": " ",
      "accountId": " ",
      "emailAddress": " ",
      "avatarUrls": {
        "48x48": " ",
        "24x24": " ",
        "16x16": " ",
        "32x32": " "
      },
      "displayName": "Kseniia Trushnikova",
      "active": true,
      "timeZone": " ",
      "accountType": "atlassian"
    }
  }
}

It appears that my Jira general configuration has the parameter User email visibility set to 'Show to logged in users only' which allows me to retrieve email addresses via the API.

While I was looking for information on this issue, I came across the article that you might find useful: https://confluence.atlassian.com/jirakb/how-to-display-the-email-address-of-the-reporter-on-a-jira-issue-1188416840.html. It describes how to get reporter email address with Automation. Will it work for you?

Suggest an answer

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

Atlassian Community Events