Forums

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

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

Team Nautilus April 22, 2020

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
Claudio Cicali April 27, 2020

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?

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

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.

Like Owen Moga likes this
Claudio Cicali April 28, 2020

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`.

Like Riaan Schutte likes this
Team Nautilus April 28, 2020

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

Mia Simundic April 29, 2020

@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); 
Claudio Cicali April 29, 2020

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

Mia Simundic April 30, 2020

Ok, thank you!

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

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.

Mia Simundic April 23, 2020

Ok. tnank you. 

What will be with Jira assignee and reporter fields?

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

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.

Team Nautilus April 27, 2020

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. 

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

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

Suggest an answer

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

Atlassian Community Events