How to get reporter email using REST API

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?

Hi @mmellaa,

By this, do you mean that the users chose to hide their email in the profile visibility controls?

If by any chance the users did not explicitly set the profile visibility controls to hide the email, you can get this information by calling the Get user REST API (see sample response body below).

However, if the email is hidden, if by any chance the respective users are part of company-specific groups, then you can use the same Get user REST API and expand groups.

For example:

GET https://mysite.atlassian.net/rest/api/2/user?accountId=xyz&expand=groups

Which will give you something like:

{
    "self": "...",
    "accountId": "xyz",
    "accountType": "atlassian",
    "emailAddress": "iragudo@acmeinc.com",

...
    "locale": "en_US",
    "groups":
    {
        "size": 6,
        "items":
        [
            {
                "name": "jira-servicemanagement-customers-iragudo",
                "groupId": "d0354380-2726-428c-a8fa-f823e4f06yyy",
                "self": "..."
            },
...
            {
                "name": "test group",
                "groupId": "352f0f19-97d5-402e-93da-439cb8f3axxx",
                "self": "..."
            }
        ]
    },
    "applicationRoles":
    {
        "size": 3,
        "items":
        []
    },
    "expand": "groups,applicationRoles"
}

Hope this helps!

Ian

1 Like

You could also have a ‘Company’ field in your request form, with values “Company 1, Company 2, Other” that you can use directly or let you add the user in groups associated to each company.

New users don’t choose visibility, hidden is default. So i need a solution for every scenario

If i add a “Company Field” any one could see the list of my customers