Forums

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

Any function to check user is active ?

Narendra Kumar
Contributor
May 20, 2020

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

1 answer

1 accepted

0 votes
Answer accepted
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 21, 2020

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:

  1. True = The user is active
  2. False = The user is not active

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:

Screen Shot 2020-05-21 at 15.21.03.png

Let us know if you have any questions.

Narendra Kumar
Contributor
May 21, 2020

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

Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 25, 2020

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.

Narendra Kumar
Contributor
May 25, 2020

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

Like Petter Gonçalves likes this
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 26, 2020

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

Like Narendra Kumar likes this

Suggest an answer

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

Atlassian Community Events