apps-script-samples
apps-script-samples copied to clipboard
getLicenseAssignments pageToken returns null value
Expected Behavior
getLicenseAssignments should return all the users in the specified domain. PageToken should be populated to allow calling more than 500 results.
url: https://github.com/googleworkspace/apps-script-samples/blob/master/advanced/adminSDK.gs
Actual Behavior
getLicenseAssignments only returns the first page and the PageToken value is null. Also, the while(pageToken) is on the wrong line. It is currently on line 212 and should be on line 220.
Steps to Reproduce the Problem
- Call getLicenseAssignments and request 500 as the max result. Assuming there are more than 500 users, you should get a list of 500 users.
- Change maxResults to 1 and you should only get one result and pagetoken is null.