Resolving Email Visibility Issues in Jira Cloud REST API Responses
プラットフォームについて: Cloud のみ - この記事は クラウド プラットフォームのアトラシアン製品に適用されます。
要約
When using the Jira Cloud REST API endpoints (e.g. Get issue or Get user) to retrieve user information, such as the reporter or assignee, you may encounter a situation where the email address is not included in the API response. This issue is often related to the User email visibility settings in Jira or User email visibility setting in Jira's system general configuration.
環境
Jira Cloud
診断
Email addresses might not be returned in the API response due to User email visibility settings in Jira personal Profile and Visibility settings or User email visibility setting in Jira's system general configuration. Please note that User email visibility setting in Jira's general configuration of Sandboxes is independent of such configuration in the parent production instance.
Difference in API response is presented below:
...
"reporter": {
"self": "https://SITENAME.atlassian.net/rest/api/3/user?accountId=712025%3A14a4cce-32a6-4142-b093-3f1eb3bf4d1",
"accountId": "712025%3A14a4cce-32a6-4142-b093-3f1eb3bf4d1",
"avatarUrls": {
"48x48": "https://example.com/avatar/4.png",
"24x24": "https://example.com/avatar/4.png",
"16x16": "https://example.com/avatar/4.png",
"32x32": "https://example.com/avatar/4.png"
},
"displayName": "Test User",
"active": true,
"timeZone": "Europe/Warsaw",
"accountType": "atlassian"
},
...
...
"reporter": {
"self": "https://SITENAME.atlassian.net/rest/api/3/user?accountId=712025%3A14a4cce-32a6-4142-b093-3f1eb3bf4d1",
"accountId": "712025%3A14a4cce-32a6-4142-b093-3f1eb3bf4d1",
"emailAddress": "test_user@example.com",
"avatarUrls": {
"48x48": "https://example.com/avatar/4.png",
"24x24": "https://example.com/avatar/4.png",
"16x16": "https://example.com/avatar/4.png",
"32x32": "https://example.com/avatar/4.png"
},
"displayName": "Test User",
"active": true,
"timeZone": "Europe/Warsaw",
"accountType": "atlassian"
},
...
原因
The discrepancy between environments can be traced back to:
- User email visibility setting in Jira's general configuration - if setting is configured to "Hidden" all email addresses will be hidden in API responses.
- User email visibility settings in Jira personal Profile and Visibility settings - if setting is configured to "Only you and admins", user's email address will be hidden in API responses.
ソリューション
To make sure email addresses are returned in API responses, follow these steps:
- Navigate to your Jira instance.
- Go to Settings > System.
- Select General Configuration.
- Click on Edit Settings.
- Locate the User email visibility option.
- Change the setting to either Public or Logged in users only.
- Click Update to save the changes.
- Send a new API request to Get issue API endpoint.
- Check the response to ensure that the email addresses are now included.
If the email address of the specific user is still not returned, make sure this user updates their profile information:
- Have the user log in to their Atlassian account and view the Profile and visibility page: https://id.atlassian.com/manage-profile/profile-and-visibility
- Under Contact find
- Under Who can see this? select Anyone.
- Changes will take effect within five minutes everywhere your profile appears.
- Send a new API request to Get issue API endpoint.
- Check the response to ensure that the email addresses are now included.
Additional Considerations
Profile and Visibility Settings: Ensure that individual user profiles have their email visibility set appropriately. Managed accounts have options such as Only you and admins, Organisation, and Anyone.
GDPR Compliance: Be aware that these settings are in place to comply with GDPR regulations, which may restrict email visibility.
For further information, please contact refer to the following Support Documentation:
- Configure Jira application options | Atlassian Support
- Update your profile and visibility settings | Atlassian Support