Overview

I found myself with an interesting Jira problem today.  We had a dashboard that wasn’t showing all issues relevant to the JQL query in the filter.   The issues were fully present in the system, but would only appear if we went in after creation and tweaked them in some way.
Essentially we had issues that weren’t being picked up by the filter because the system didn’t see them as “complete”.

Here’s the sanitized JQL:

project = <project> AND status = Queued AND "<Custom Field>" = "<value>"

It was picking up some of the issues, remember. And the issues were all created in the same way: they came in through the Service Desk as Service Requests. So the JQL wasn’t the issue.

Trying Different Solutions

I already had a listener running as part of the process, so I tried adding an issueUpdate statement to it:

issueManager.updateIssue(user, issue, EventDispatchOption.ISSUE_UPDATED, false)

This did not resolve the issue.   I next tried updating the issue summary to be itself as part of the Workflow Transition process:

issue.setSummary(issue.summary + " - " + issue.reporter.displayName)

This also did not resolve the issue.

Resolving the Issue

In the end I solved the issue by introducing a re-index to a Listener that was listening for Issue Updates:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.index.IssueIndexingService


ComponentAccessor.getComponent(IssueIndexingService).reIndex(issue)

By triggering a re-index of the issue, the system was enticed to view the issue as complete, and the dashboard displayed it.  Please note that this is different than a re-index of the entire system.

It may be the case that if the issue sat long enough, the reindex would happen automatically. However, it may often be the case that an organization does not have the time to sit and wait for issues to sort themselves out.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>