How to find user by custom field through REST API?

harish287 April 7, 2020

I need to get the user details using custom field and the user data should include all the fields.

1 answer

1 accepted

0 votes
Answer accepted
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 8, 2020

Hello @harish287 ,

I am not sure what you mean when you say that you want to get user details using a custom field. Could you please clarify?

Also, is there any specific reason to use Jira Service Desk REST API only? 

 

Finally, please notice that this is not the best place to get help on development related questions. The right resources are listed in https://developer.atlassian.com/resources. 

Specifically:

 

Cheers,
Dario

harish287 April 8, 2020

@Dario B Thanks for your suggestion.

No I was wrongly mentioned ServiceDesk API

My question is I want to find user object by customField value. using JIRA Rest API's.

 

Please suggest me for this.

Thanks

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 8, 2020

@harish287 ,

What do you have in the custom field and what kind of user data are you expecting to be able to get? 

harish287 April 8, 2020

@Dario B 

it's a Phone Number field and it is text type which is added to user Object.

So by using phone number value, I want the user object.

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 9, 2020

Hi @harish287 ,

What you could do is the following:

  1. Each user has a phone number associated using User Properties. For details see the example: Storing data against an entity with REST
  2. Make the entity property searchable as explained in the same documentation page, in the section: Making searchable entity properties
  3. At this point, having a phone number in a custom field, you can get the field value and then search for that value in order to find the user associated to it.

For details, please see:

 

I hope this helps.

 

Cheers,
Dario

harish287 April 14, 2020

@Dario B  Thanks for your response and suggestion.

I used the iql to get User Object

Like Dario B likes this
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 14, 2020

You are very welcome @harish287  I am happy to know I was able to help! :) 

Like harish287 likes this

Suggest an answer

Log in or Sign up to answer