Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

GET all users from a board with specific status using basic auth

Hi!

 

Is there any way to get all users with specific status which are set in the board? I want to get all users with `status='service desk'` so I was trying 

curl -D -u USERNAME:PASSWORD -X GET -H "Content-Type: application/json" https://company_name.atlassian.net/rest/api/2/user/assignable/search?project=SERVICEDESK

But it doesn't worked, is there any way to do so using username and password instead of token? 

1 answer

0 votes
Dario B Atlassian Team Feb 04, 2020

Hi @maciej.wicher ,

I have difficulties understanding what you are trying to achieve. Specifically I am not sure I understand:

get all users with specific status which are set in the board

Can you kindly provide more details on what you are trying to do (screenshots are welcome) so that I can try to assist? 

 

For the rest, looking at the provided REST API call:

  1. The endpoint /rest/api/2/user/assignable/search returns a list of users that can be assigned to an issue and has nothing to do with boards:

    Find users assignable to issues

    GET /rest/api/2/user/assignable/search

    Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be assigned to:

    • a new issue, by providing the projectKeyOrId.
    • an updated issue, by providing the issueKey.
    • to an issue during a transition (workflow action), by providing the issueKey and the transition id in actionDescriptorId. You can obtain the IDs of an issue's valid transitions using the transitions option in the expand parameter of Get issue.

    In all these cases, you can pass an account ID to determine if a user can be assigned to an issue. The user is returned in the response if they can be assigned to the issue or issue transition.

  2. Assuming that SERVICEDESK is a project key, calling the below endpoint will return all the users that have assign issue permission in that project: 
    https://company_name.atlassian.net/rest/api/2/user/assignable/search?project=SERVICEDESK
     
  3. The provided example will never work since basic authentication with username and password has been deprecated long time ago and replaced by basic authentication with email address and API Token. Therefore your call is supposed to be:
    curl -D -u EMAIL_ADDRESS:API_TOKEN -X GET -H "Content-Type: application/json" https://company_name.atlassian.net/rest/api/2/user/assignable/search?project=PROJECT_KEY
  4. Depending on your user rights and on the other users Profile Visibility Settings, you might not be able to get the email addresses of the assignable users. 

 

 

For more details please see:

 

 

Cheers,
Dario

Thanks for you answer @Dario B  By user with specific status I mean user with specific role. I found an answer how to do that here - https://community.atlassian.com/t5/Answers-Developer-Questions/List-of-users-in-project-REST-API/qaq-p/536820

But maybe you will give me a hint how to find all issues for specific project (key: servicedesk) assigned to specific user ?

 

Cheers,

Maciej

Like Dario B likes this
Dario B Atlassian Team Feb 07, 2020

Hi @maciej.wicher ,

You very are welcome :)

In order to search for all the issues for the specific project assigned to a specific user you can use the search endpoint, GET or POST methods (REST API v2 or v3):

 

The JQL you will have to pass as a URL argument or in the request body, depending on which method you decided to use, is the below one:

project = servicedesk AND assignee = USER

 

Therefore, for example, if going for the GET method you can call:

https://NAME.atlassian.net/rest/api/3/search?jql=project%3DSERVICEDESK%20AND%20assignee%3DUSER

 

Let me know if this helps.

 

Cheers,
Dario

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you