Using the JIRA CLI getUserList function with a regex Edited

Hi,

I'm trying to get a filtered user list with JIRA CLI. My goal is to get all users without "@mycompany.com" in the username.

I succeed to run the command line with the --name "@all" argument:

--action getUserList --name "@all"

So, I added a regular expression to filter the results:

--action getUserList --name "@all" --regex "^[^@]*$"

Unfortunately, it returned all the users (included the users with @mycompany.com in their username).

I'm wondering if the regular expression applies on username only or on all the user metadata (e.g. username, full name, email) ?

I'm using JIRA Core 7.4.1 with JIRA CLI 6.8.0.

1 answer

This widget could not be displayed.

I'm not sure if the regex is being applied to just username or the full meta data.   But I don't think your regex will return the results you want here.   I was playing with some sample data on Regexr and I think I came up with a regex that should be able to return a list of users, minus the ones at @mycompany.com

Try this out for the regex part:

(?!\b.*@mycompany\.com\b)(\b.*@.*\..*\b)

This uses a negative lookahead function.  First it's looking to match the first anything@mycompany.com and those results are discarded outright.   From there it's just trying to find any valid email address that follows the format of username@domain.tld

 

 

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

48 views 2 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you