How to search for issues created by a user with a particular domain in its email address?

Floris Vlasveld February 9, 2013

I'd like to search for issues that have been created by users with an email address containing "domain.com". I tried the following JQL statement:

reporter ~ "@domain.com"

Unfortunately, this results in the following error message:

The operator '~' is not supported by the 'reporter' field.

Is there any way to work around this? I'd like to have this functionality to only trigger a webhook URL when a user with a particular domain in its email address open the issue.

1 answer

1 accepted

2 votes
Answer accepted
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 9, 2013

Hi Floris

The Atlassian Jira Toolkit Plugin which is available in OnDemand provides a custom field type "Domain of reporter"

Add a customfield of this type to your view screen ( to check it works) and make sure it has a text searcher

Regards

Dieter

Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 9, 2013

Please make sure you reindex Jira after you add the custom field.

I recommed to make the field global so it's available in all projects

Floris Vlasveld February 9, 2013

Thanks for you help Dieter! I added the custom field with the free text search template and re-indexed Jira. Indeed the issues now have a 'Domain of Reporter' field populated. However, the JQL statement:

"Domain of Reporter" ~ "domain"

also returns

The operator '~' is not supported by the 'Domain of Reporter' field.

Floris Vlasveld February 9, 2013

:-)

Yes it would. Thanks!

Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 9, 2013

Besides this problem wouldn't it be sufficient to search this field using the equals operator?

Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 9, 2013

It's strange the CONTAINS operator doesn't work. Will look into this deeper if the problem persists after reindexing and restarting Jira

Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 9, 2013

Reindexing and Restarting didn't help so i had a look in the source of the plugin and found that the searcher you can select isn't a free text searcher but indeed an exact text searcher. The source code in com.atlassian.jira.toolkit.customfield.searchers.DomainSearcher looks like

public class DomainSearcher extends ExactTextSearcher implements CustomFieldStattable
...

This won't allow ~ searches, just = searches. To support CONTAINS (~) searches it should be

public class DomainSearcher extends TextSearcher implements CustomFieldStattable

To me this looks like a bug in the plugin, at least the label "Free text ..." when selecting the searcher is misleading. You should report this in the projects issue tracker if using the exact text searcher isn't sufficient for you. It also helps to make the Atlassian support aware of this issue.

Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 9, 2013

Anyway the way it is now the field also implements CustomFieldStattable which means you can include it in the statistics gadgets and create nice two dimensional statistics about your reporter domains. Not sure if that would also be possible with the TextSearcher

Suggest an answer

Log in or Sign up to answer