error "The query parameter 'username' is not supported in GDPR strict mode"
Asked by Khalil:

Hi !

We have a workflow that does the following:

1- query the user infos of a certain email address (example; <https://ID.atlassian.net/rest/api/2/user/search?username=name.lastname@ID.com>)

2- Parse the response and put the accountID into a variable

3- Use that variable to create an issue.

Now all this doesn't work anymore cause if the error: error "The query parameter 'username' is not supported in GDPR strict mode". The configuration in Global Admin \> General Settings for e-mail visibility settings doesn't change a thing.

Do you guy know any solution to this ? how to create an issue with email? cause i tried "reporter":{"name":"name.lastname@ID.com"} and it came empty. ?

Thanks in advance for any idea !


Answers:
author: Petter Gon?alves
body: Hello [@Khalil Ben Amor](/t5/user/viewprofilepage/user-id/3389542)

Thank you for reaching out.

The error you are facing happens because of the implementation of the new [European General Data Protection Regulation (GDPR)](https://www.atlassian.com/blog/announcements/atlassian-and-gdpr-our-commitment-to-data-privacy), where the parameters used to identify users in REST API as "username" and "userKey" were replaced by the Atlassian account ID (accountId).

You can find more information regarding this change in the documentation below:

* [Deprecation notice and migration guide for major changes to Jira Cloud REST APIs to improve user privacy](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/)

That being said, you must specify the accountId in the REST API to return the users of your Jira Cloud site:

GET [/rest/api/3/user?accountId=xxxx](https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-rest-api-3-user-get)

You can also search for the user's e-mail with the following API:

```
GET /rest/api/3/user/search?query=<e-mail>
```

To know the Account ID of multiple users by their usernames, you can use the **experimental Endpoint** below:

```
GET /rest/api/3/user/bulk/migration?username=xxxx&username=xxxxx
```

Let us know if you have any questions.

comments: author: Anushaath
body: Hey [@Petter Gon?alves](/t5/user/viewprofilepage/user-id/195424) ,

I'm running a Jira Server instance and for search for a user I'm using

GET [/rest/api/3/user/search?query=\<e-mail\>](https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-rest-api-3-user-get)

And I'm still getting the username not supported error. I'm not even passing the username here.


author: Anushaath
body: Hi [@Petter Gon?alves](/t5/user/viewprofilepage/user-id/195424) ,

I'm running a Jira Server instance and i like to search a user.  

Currently i'm calling the :

```
GET /rest/api/2/user/search?query=<e-mail>
```

It returns the 'Username' not supported error. I'm not even passing the username field. Is query supported for Jira Server users?


author: Petter Gon?alves
body: Hello [@Anushaath](/t5/user/viewprofilepage/user-id/4044385)

As far as I checked, the deprecation of usernames is only applicable to Cloud, so you should be able to still get the relevant users by using their usernames:

```
get http://www.example.com/jira/rest/api/2/user?username=fred
```

Let me know if that endpoint still works for you.


author: Khalil
body: It works without any more issues: <https://vistaprint.atlassian.net/rest/api/3/user/search?query=example@domain.com>


author: Anushaath
body: Yes thank you [@Petter Gon?alves](/t5/user/viewprofilepage/user-id/195424) .

The Jira server implementation indeed accepts the username parameter.


Tags: advanced-roadmaps

api

cloud

error

gdpr

issue

jira

user