Search shows old issue summary


I have just wrote a listener, which updates summary of Sub Tasks if summary of a parent task is changed. It works fine except one thing:

Search always shows previous version of summary of Sub Tasks. 

I did reindex, but that doesn't help. Reindex function looks like this:

void ReindexIssue(Issue anIssue, String logPref) {
    if (log.isDebugEnabled()) {
        log.debug logPref + "Reindexing issue " + anIssue.getKey()
    boolean wasIndexing = ImportUtils.isIndexIssues()

Every time in search I can see previous version of summary, however if I open Sub Task I can see the correct one. 


Thanks in advance. 

4 answers

1 accepted

In trying to debug your problem I wrote the script from scratch more or less coming up with the below.

The problem is your EventDispatch option - if you say DO_NOT_DISPATCH then the indexer does not receive notification that it needs to reindex. This worked for me:


Hi @Jamie Echlin (Adaptavist), solution seems to work for me, thank you so much!

What mechanism are you using to update the subtasks? I'd strongly recommend using IssueService.update in order to update the sub-tasks. The IssueService class makes sure business logic, like automatic reindexing, gets followed, where the IssueManager may not always do so. It's a bit more elaborate though, as you need to get a validation result first. You can see an example on It's doing other things, but the thrust of it is

import com.atlassian.jira.component.ComponentAccessor

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def faveFruitOtherFld = customFieldManager.getCustomFieldObjectByName("Favourite Fruit (Other)")
def issueService = ComponentAccessor.getIssueService()
    def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
    def issueInputParameters = issueService.newIssueInputParameters()
    issueInputParameters.with {
        addCustomFieldValue(faveFruitFld.idAsLong, option.optionId.toString())
        addCustomFieldValue(faveFruitOtherFld.idAsLong, null)
    def updateValidationResult = issueService.validateUpdate(currentUser,, issueInputParameters)
    if (updateValidationResult.isValid()) {
        issueService.update(currentUser, updateValidationResult)

That code isn't complete on its own, but it should suggest how to build the issueInputParameters and pass them to validateUpdate.

Hi Jonny,

I have similar function:

void UpdateIssue(Issue updatedIssue, ApplicationUser applicationUser, IssueInputParameters issueInputParameters) {

    ApplicationUser loggedInApplicationUser = ComponentAccessor.getJiraAuthenticationContext().getUser()

    IssueService.UpdateValidationResult updateValidationResult = ComponentAccessor.issueService.validateUpdate(applicationUser,, issueInputParameters)

    if (updateValidationResult.isValid()) {
        IssueService.IssueResult updateResult = ComponentAccessor.issueService.update(applicationUser, updateValidationResult, EventDispatchOption.DO_NOT_DISPATCH, false)
        if (updateResult.isValid()) {
            log.debug 'Issue updated: '
        } else {
            log.error 'Error updating issue'
    } else {
        List<String> errorList = new ArrayList();
        for (int i = 0; errorList != null && i < errorList.size(); i++) {
            log.error 'Error validating update' + errorList.get(i);


And also I have this one 

void UpdateSummary(Issue anIssue, String devSummary, String logPref){
    log.debug logPref + "Issue: " + anIssue.key + " Summary: " + devSummary
    MutableIssue mutableIssue = ComponentAccessor.getIssueManager()getIssueObject(anIssue.key)
    ComponentAccessor.getIssueManager().updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(), mutableIssue, UpdateIssueRequest.builder().eventDispatchOption(EventDispatchOption.ISSUE_DELETED).sendMail(false).build())

They both work, but result is the same, search shows old summary. 

The first one should work. The second one will update the issue but without reindexing.

Are you sure the listener is only firing on the parent tasks, and not firing on both parents or subtasks?


@Jamie Echlin (Adaptavist) I have just updated listener to fire only on parent issue type, but result is still the same, summary is updated, but filter shows previous summary. 

FYI: same code in Post Function works exactly as expected, e.g. filter shows proper results. 

Hi Brushan,

I have 6.4.7 JIRA, and unfortunately I can't import this class

unable to resolve class com.atlassian.jira.issue.index.IssueIndexingService
 @ line 29, column 1.
   import com.atlassian.jira.issue.index.IssueIndexingService
1 error
        at org.codehaus.groovy.control.ErrorCollector.failIfErrors(
        at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(
        at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(

Tried also to use it like this:

IssueIndexingService indexing = (IssueIndexingService) ComponentAccessor.getComponent(IssueIndexingService.class);

But got:

unable to resolve class IssueIndexingService
 @ line 125, column 42.
            IssueIndexingService indexing =

Does anyone else have any ideas? @Jamie Echlin (Adaptavist) ?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted 4 hours ago in United States

Atlassian acquires AgileCraft

         Good Day, Bad bad traffic, not sure why!!!! 1/2 hour commute took me 2 hours today 🤯 What helped me is that I kept browsing LinkedIn until...

25 views 1 0
View post

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