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

I'm using jira rest client api 5.1.0, but due to GDPR change I have a problem with search user

I'm using jira rest client api 5.1.0, but due to GDPR change I have a problem with search user.

What is substitution for this: 

Promise<Iterable<User>> findUsers(String username, @Nullable Integer startAt, @Nullable Integer maxResults,
@Nullable Boolean includeActive, @Nullable Boolean includeInactive); 


GET path/search?searchTerm=mar

Response:

{    "statusCode": "ERROR",   
 
"message": "java.util.concurrent.ExecutionException: com.google.api.client.http.HttpResponseException: 400\n{\"errorMessages\":[\"The query parameter 'username' is not supported in GDPR strict mode.\"],\"errors\":{}
}"

How can I search for users now to fill assignee field?

2 answers

0 votes

Hello @Team Nautilus

Thank you for reaching out.

As you can see in this deprecation notice, Jira REST API has started to use the AccountId parameter as the unique identifier instead of 'Username' and 'userKey'. Can you please check if the AccountId parameter works for you?

If you are not being able to return any information with that parameter, please ask for help is in the Atlassian Developer Community:

https://community.developer.atlassian.com/ 

The mentioned portal was specifically created for development questions, where you will find articles and suggestions from other third-party partners and Atlassian developers. Feel free to open a new topic about your question there if my answer was not helpful.

Let us know if you have any other questions.

Ok. tnank you. 

What will be with Jira assignee and reporter fields?

Hello @Mia Simundic

As you can see in the deprecation notice provided above, the Assignee and reporter fields will also use the AccountId (id) instead of name.

Let us know if you see any different behavior when running your REST API.

If I am jira user, and I want to add assignee to the ticket, what can I write in assignee field - accountId? If username is depricated, how can jira user add assignee or reporter?

If it is not possible to search users by usernames, but it is possible by accountId, end user of jira doesn't know accountId of jira whom he wants to add assignee. 

Hello @Team Nautilus

If you don't know the accountId of your users, you can simply search by their usernames using the REST API below and the AccountId will be returned to you:

Get account IDs for users 

If you want to run it directly in your browser, you can run the URL below, replacing "yourdomain" and "yourusername" with the domain of your site and the usernames of the users you want to know its accountId, respectively:

https://yourdomain.atlassian.net/rest/api/3/user/bulk/migration?username=yourusername

Even "lastname" and "firstname" are removed from the search in this "strict mode" (and the deprecation notice does not mention them, only the username).

 

We need this search to work: how can we disable the strict mode?

Hello Claudio,

I believe it is not possible to disable the Strict mode once the GDPR is implemented. This is a security policy required in Jira application, where the accountId is the unique user identifier.

You can check in my last answer how you can get the AccountId of the users by its username.

As it turned out, it's just a matter of using the `query` parameter with the `/search` path and we are back in business. Just avoid using `username`.

Can you please give some example of using 'query' parameter to search user?

@Claudio Cicali, thank you for the answer.  May I ask you which method from rest client api  you are using behind this endpoint ?

I'm using this one, and it is affected with gdpr change:  

Promise<Iterable<User>> findUsers(String username, @Nullable Integer startAt, @Nullable Integer maxResults,
@Nullable Boolean includeActive, @Nullable Boolean includeInactive); 

@Mia Simundic hey, we are not using the client but just an HTTP client call; I can't help you with that.

Ok, thank you!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Software

How to create Jira issus from Excel file?

When to use CSV importer When managing your processes in Jira, there are many occasions where you need to create a lot of tasks. Creating them one by one will cost you a lot of time and effort and i...

3,678 views 15 26
Read article

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