Hi there,
I am building this API call to build an export of Jira users
Here is part of the call from a get-Atlasusers function I created.
$results = @()
while ($true) {
$url = "https://$workspaceName/rest/api/3/users/search?startAt=$startAt&maxResults=$maxResults"
$result = Invoke-RestMethod -Uri $url -Headers $headers
I have a for each which loops through the results then creates a CSV of Atlassian ID, Name and email address, but I am getting null for email address.
I am calling my function here (a subset here)
$AT_users = Get-AtlassianUsers $token
$export = @()
foreach ($AT_user in $AT_users) {
try {
$export += [PSCustomObject]@{
Atlassian_ID = $AT_user.accountId
Name = $AT_user.displayName
email = $AT_user.emailAddress
I am not sure why I am getting results except for email address here?
E-mail address API is only available if you're an app vendor, see details here and access to it was removed due to GDPR. So if you're simply using this just for your organization. I'll suggest you go with the organization API instead if you want to get the email addresses of users within your organization. Otherwise, you can inform your users to tweak their personal privacy settings and share their email addresses with the administrator so it becomes visible. The former seems to work better in your use case.
Thanks, I was trying that with my own test instance and keep getting a 401.. but when I do the same thing just with the users it works fine just no email.
Will have to see what I need to change auth wise I think.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Prince Nyeche yeh I am stuck. I have everything in place (I think) bearer token using the API Key I generated from the admin.atlassian page, I have the org ID from the site, I plug in the GET.. 401 every time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That would be the wrong API to use, you need to generate an API from https://id.atlassian.com/manage-profile/security/api-tokens if you want to access that endpoint.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm ok I am getting a 200 now (tick), just not getting any users back?!
Will keep digging, thanks for the link also.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I need to claim the domain!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ste404 ,
Not sure, but I believe you need to apply to Atlassian for access to email addresses. My recommendation is to contact support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.