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

How to prevent JIRA indexing while iteratively processing a large number of issues in Groovy Runner?

Shaakunthala July 5, 2015

I'm bulk adding labels to JIRA issues using a custom Groovy script as explained in the answer to the following question:

https://answers.atlassian.com/questions/132132

When processing about 10,000 issues in a Groovy I don't want to let JIRA re-index each issue because it slows down the entire process. For example, when using LabelManager.addLabel() method in a loop, JIRA apparently indexes each issue.

Is it possible to programmatically suppress indexing of each issue until the script completes? (then I'll do a full re-index after everything got completed)

Thanks!

Shaakunthala

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted
Jozef Kotlár
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.
July 5, 2015

I would guess IssueIndexManager:hold() do the job. The indexing should be held till release().

Shaakunthala July 5, 2015

Thank you! I'll give it a shot right away.

Shaakunthala July 5, 2015

:( I'm working on an old instance (5.0.x) and this method is available from 5.1 up. So it doesn't work. Thank you for the answer - it's helpful though it doesn't work for me at this time.

1 vote
Volodymyr Krupach
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.
July 6, 2015

Hi Sameera,

You can use addLabel from LabelService instead of LabelManager. Unlike LabelManager, LabelService should not perform reindexing. Javadoc says nothing about reindexing but you can notice that DefaultLabelManager constructor takes IssueIndexManager as parameter and LabelService does not have IssueIndexManager as param. I believe that the same situation with all other corresponding Manager and Service classes. At least I am sure about IssueManager and IssueService.

Jozef Kotlár
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.
July 6, 2015

LabelService is built on LabelManager and IssueManager - I guess the issue will be indexed underhood.

Volodymyr Krupach
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.
July 6, 2015

You are right, I made wrong conclusion :-(

TAGS
AUG Leaders

Atlassian Community Events