Hi,
I have a list of users. Is there any in built Jira API based function to check that user is active or not ?
Any way so that I can apply that function using loop and can get true or false if user is active/inactive.
Your help is really appreciated. Thanks!
Regards,
Narendra Kumar
Hello @Narendra Kumar
Thank you for reaching out.
Per your description, I understand that you are looking for a rest API point that provides if a specific user is active or not. Is that correct?
The default REST API to search for users provide you with the active parameter, which can have the following values:
You can use one of the REST API below to return that information, properly adding the accountId or e-mail of the user:
GET yourdomain.atlassian.net/rest/api/3/user?accountId=xxxx
GET yourdomain.atlassian.net/rest/api/3/user/search?query=<e-mail>
Here's a practical example:
Let us know if you have any questions.
Yes @Petter Gonçalves thank you for your reply. It's fine that active is giving true/false.
But I just want to see any existing function like string has to check so many things length, uppercase, lowercase etc.
Is there any similar function exist so that I can check with account ID of user and it gives me true or false based on active or inactive user.
Hope it's clear to you. Let me know how it works for you.
Thanks,
Narendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Narendra Kumar
Thank you for providing more details about your need.
I'm afraid Jira API does not have an endpoint to only return true or false if a user is active or not, however, could you please give us more details on how do you need this feature?
If you are trying to create a script or an integration with another app, I believe it should be easy to isolate the "active" parameter from the endpoint I provided, however, please let us know more about your goal so we check another option for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Petter Gonçalves I really appreciate your support and help for me.
Actually, I am trying to set a variable value as null, if user is inactive. I've come up with this as per your solution in first comment here.
Thank you for your support.
Regards.
Narendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm glad to know my answer helped you @Narendra Kumar
Have a nice week and please let us know if you have any other questions.
Regards,
Petter Gonçalves - Atlassian 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.