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

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

Is there any way which can re-index issue when particular custom field's value is changed?

Hi Everyone,

As title, is there any way which can re-index issue when particular custom field's value has been changed? Or does anyone know how to write a listener for re-indexing issues and subtask issues? I tried some groovy scripts which were provided on other posts but it seems not working. Please help me on it. Thank you very much!

 

Best Regards,

KH

1 answer

1 accepted

0 votes
Answer accepted

If you need to reindex an issue in a script, you can do so like this:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.index.IssueIndexingService
def indexManager = ComponentAccessor.getComponent(IssueIndexingService.class)
indexManager.reIndex(myIssue)

Hi @Payne ,

Thanks for answering my question! Sorry, I have one more question, if I want to let this reindexing script only work when customer field's value is changed, how should I write the condition in this script? Thank you very much! 

 

Best Regards,

KH

Payne Community Leader Jul 15, 2021

Ah, that I'm not sure about offhand. Maybe someone else can chime in with guidance on that.

Suggest an answer

Log in or Sign up to answer
TAGS

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