I'm attempting to generate the URL to search for users using the REST API, but not getting reasonable results.
For example, if I want to search for users whose names start with "A", I would expect to use
https://mycompany.jira.com/rest/api/2/user/search?username='\Aa*'
where \A is the regular expression anchor for start of expression, start with the letter a, and have any number of characters after the a.
What I get back is []
?? JIRA documentation says I can use a string after the username expression, and a string is defined as having a pattern, and a pattern is defined by W3 as being able to use a regular expression bounded by delimiters. Even if I do without delimiters "...?username=a*" I get a response which indicates no matches - if I just do "...?username=a", I get anything with an A in it - not that merely starts with A. (I tested this with a B, and my first response was a name starting with...A.)
Any ideas?
Community moderators have prevented the ability to post new answers.
Hi Lee,
Actually to search for user starting with an 'A', you can just run the following REST request:
curl -u admin:admin http://localhost:2990/jira/rest/api/2/user/search?username=a
Based on my quick test, the above request will return users with username starting with A.
Hope that this will help.
if I run that, i get JSON results back that include things like ".../rest/api/2/user?username=tadkins" as well as "...rest/api/2/user?username=mwagner""
So it's picking folks with an "a" anywhere in the username. That's why I think a regular expression is required...unless it doesn't really use regular expressions.
I'm in OnDemand, which might be different, although I can't see why.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Doesn't look like there's a solution. Moving on...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Didn't find an answer to this unfortunately, so I wound up running thru the entire alphabet, then removing duplicate entries. :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.