Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I check if users have access to each product?

Sam August 20, 2023

Hello folks,

I would like to automate the process of removing access to each product according to the user's last active date. (The automation process is implemented with Google apps script.)

https://developer.atlassian.com/cloud/admin/organization/user-last-active-dates/
I was able to get the user's last active date by following the steps in the link above, but it seems that it can also get the last active of some products that has already been deleted.

So, in order to make a list of users whose access is to be removed by product, I think we need to put in a process to check if the user has access to each product.

https://developer.atlassian.com/cloud/admin/organization/rest/api-group-users/#api-v1-orgs-orgid-users-get
Using this API, it seems that we can get "product_access".
There is no error, but the data content is empty and no information could be retrieved.

{ data: [], links: { self: 'https://api.atlassian.com/admin/v1/orgs/{orgid}/users' } }

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-users-search-get
Using this API, I was able to get users information, but there was no "product_access" information in it.

How can we solve this problem?

Thank you,

2 answers

0 votes
Carla
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 3, 2024

same problem ... 
But then I checked in the managed accounts(go admin menu > Directory > Managed accounts menu) menu, and it says
access was not set.
I'm guessing that if you allow access for each application, there will be a product access value.

 

2024-09-04 092450.png

0 votes
Patricia Modispacher _appanvil_
Atlassian Partner
August 21, 2023

Hi there. APIs can sometimes be complex to work with ... You could double-check that you're using the correct API endpoints for retrieving user information and product access. The links you provided seem accurate, but make sure they are correctly integrated within your Google Apps Script.

Sam August 21, 2023

Thanks for the reply.

The API for 'https://api.atlassian.com/admin/v1/orgs/{orgId}/users' returns 200, so I don't think that is the problem.

https://community.atlassian.com/t5/Jira-questions/Atlassian-Admin-API-not-returning-list-of-Users-in-Postman/qaq-p/1902096
↑This seems to be a similar question, but it seems to be guided to a different API and not a fundamental solution.

Patricia Modispacher _appanvil_
Atlassian Partner
September 8, 2023

Sorry for the late reply, was on sick leave. 
Hm, are you sure your script is using the correct authentication method (e.g., OAuth, API token) @Sam ? Confirm that it has the required scopes to access user and product data.

Suggest an answer

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

Atlassian Community Events