Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Validator logic - Jira expression

Kishore July 14, 2020

On the portal we have one user picker field. During the creation of the request from the portal we would like to validate the user picker field that the user is provided the correct email address and user needs be available on the Jira system. If the user does not available or not provided the correct email address then it should show an error on the portal. 

 

We are using the JMWE, JWT and scriptrunner apps.

 

2 answers

1 accepted

1 vote
Answer accepted
Thorsten Letschert _Decadis AG_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 27, 2020

Hi @Kishore ,

so that the public can also participate in the solution we worked out via our support, here again briefly summarized:

The goal was to distinguish between users with a 'default' username and users where the username is an email address, e.g. demo.user vs. demo.user@example.com

This was achieved with a boolean validator by Jira Workflow Toolbox with the help of some regular expression magic:

NOT matches(%{nnnnn},"([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9_-]+)") 

in this scenario, nnnnn had to be replaced with the field code of the single user picker used to validate.

Cheers
Thorsten

1 vote
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 14, 2020

Hi,

If you have a User Picker field, only existing, valid users can be input so I'm not sure what you're trying to validate here.

Kishore July 16, 2020

Hi @David Fischer ,

Yes, that's true. Basically we want to restrict the customer to provide the username on the user picker field and if any username is contains with email address as a username and if they provide email address on the user picker field then Jira should not allow to create a request from the portal.

 

Regards,
Kishore.

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 16, 2020

I'm still confused, because a User picker will not let customers enter anything that's not a valid user (it's a user picker, not a freeform text input). If the customer types an email address and that email address matches a valid user, then it will be accepted - but then it's a valid user...

Or are you trying to accept only specific users (from specific groups, or with specific project roles, etc.)?

Like olga.n likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events