We are writing node script to list all the user with last login date and role of the user(admin or normal user) in Jira. We are not able to find any related api in the documentation which provides last login date and role.
Is there any REST api's which can help us to retrieve last login date and role(admin or normal user) of all users?and what is the minimum access level for jira token to call those api?
Welcome to community! Such an API to list the last login doesn't exist or is not public yet. And I don't think this option would be available without some form of Atlassian access feature.
Likewise, the minimum requirement needed for a user to use the api basically depends on the permission the user has on the instance or projects. To call the roles a user belong to, you basically need the Administer Jira permission to retrieve such information.
You need to be an admin before you can query an api to list all the users on the instance. However, knowing which user is admin or not depends on your user group. You can use the group api to determine if a user is in a certain group to differentiate if they are admin or normal users.
Check your Jira admin hub to determine the admin groups that are available on your instance first, then you can be able to distinguish them.
for the part of "last login" information you are looking for is a Suggestion open with Atlassian.
Clicking on "Vote for this issue" could help Atlassian in prioritizing the Suggestion.
In case you click on "watch" you will be notified about the progress.
For the rest of your question I can see you receive some valuable information already.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event