It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Two Dimentional Filter Statistics - filter not retrieved even though it's accessible

Vijay Khacharia Sep 24, 2015

We have a case in which the Two Dimentional Filter Statistics gadget doesn't manage to retrieve a filter (due to a NullPointer exception in the logs) when accessed by a not logged-in user. We get the following error:

"The filter configured for this gadget could not be retrieved. Please verify it is still valid on the issue navigator."
See attachments for screenshots and exceptions in the log.

However, if I run the filter over UI it works correctly, so it's accessible by anonymous.
If there is a user logged in the gadget shows correcly.

The issue occurs when the gadget is configured to filter on a custom field, which uses a "Exact Text Searcher (natural)" searcher, provided in Natural Searchers for JIRA.

Below is the exception in logs.

2015-09-22 08:17:26,231 http-bio-8080-exec-15 ERROR anonymous 497x31248x2 590yqe 10.57.27.188,10.228.247.68 /rest/gadget/1.0/twodimensionalfilterstats/generate [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: null
java.lang.NullPointerException
	at sk.eea.jira.searchers.natural.ExactTextStatisticsMapper.getSearchRequestAppender(ExactTextStatisticsMapper.java:84)
	at sk.eea.jira.searchers.natural.ExactTextStatisticsMapper.getSearchUrlSuffix(ExactTextStatisticsMapper.java:55)
	at sk.eea.jira.searchers.natural.ExactTextStatisticsMapper.getSearchUrlSuffix(ExactTextStatisticsMapper.java:14)

JIRA version is 6.4.11

1 answer

1 accepted

0 votes
Answer accepted
Vijay Khacharia Sep 24, 2015

Downloaded the code and updated the code to do a null check for anonymous access. Now it works.

Joseph Fernandes Apr 01, 2016

Would you mind elaborating on how you implemented your null check? We are hitting the same issue- users who are logged out cannot see the results of our filter.

Vijay Khacharia Apr 04, 2016

Hi Joseph,

I just did a  null check in the method that is throwing the exception.

@Override
	public SearchRequestAppender<String> getSearchRequestAppender() {
        if(authenticationContext.getUser() == null) {
            return new ExactTextSearchRequestAppender(customFieldInputHelper.getUniqueClauseName(null,
                    customField.getClauseNames().getPrimaryName(), customField.getName()), Operator.EQUALS);
        }
		return new ExactTextSearchRequestAppender(customFieldInputHelper.getUniqueClauseName(authenticationContext.getUser().getDirectoryUser(),
				customField.getClauseNames().getPrimaryName(), customField.getName()), Operator.EQUALS);
	}

customFieldInputHelper is not throwing the null when the user passed is null.

 

Regards,

Vijay.

Joseph Fernandes Apr 04, 2016

Thank you!

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Marketplace Apps & Integrations

Join our webinar: “Asset Management: The Role of Context in ITSM” with Atlassian & Riada

  Hi Atlassian Community! This is Teresa from the Jira Service Desk team. On June 19th, I’ll be hosting a webinar “Asset Management: The Role of Context in ITSM” with Atlassian Partne...

178 views 2 3
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you