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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,654
Community Members
 
Community Events
184
Community Groups

How add Re-index in my code ?

Edited
Oliver Smith
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.
Oct 25, 2022

Hello everyone, I have an SLA counter, which, depending on whether the time has expired or not, has the status "Ok" or "Fail".
My problem is that the tasks don't change the index after changing the result on the spinner, which restricts searching through JQL. Only manual reindexing solution worked for me .When I do reindexing with my hands, only then I get all the tasks in the search
From the link below. https://docs.adaptavist.com/sr4js/6.57.0/features/built-in-scripts/re-index-issues?utm_source=product-help 

Is it possible to add this somehow to my code? 
My code

https://drive.google.com/drive/folders/1xPmWrKHTCv-SUh7vO6J0hzdwmYXJoOFA 

Thank you!

уауй.png

1 answer

1 accepted

1 vote
Answer accepted
Tom Lister
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 25, 2022 • edited
def setSLA(issue, value) {
fieldName = 'Counter status'
customFieldManager = ComponentAccessor.getCustomFieldManager()
customField = customFieldManager.getCustomFieldObjectByName(fieldName)
if (customField.getValue(issue).toString() != value) {
fieldConfig = customField.getRelevantConfig(issue)
optionsManager = ComponentAccessor.getOptionsManager()
option = optionsManager.getOptions(fieldConfig).find { it.value == value }
changeHolder = new DefaultIssueChangeHolder()
customField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(customField), option), changeHolder)
def issueIndexingService = ComponentAccessor.getComponent(IssueIndexingService)
issueIndexingService.reIndex(issue)
}
}
Oliver Smith
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.
Oct 26, 2022

@Tom Lister  Hi! It worked! Thank you very much!!! You just have no idea how much you helped with this issue! Many thanks to you !!!

Oliver Smith
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.
Jan 27, 2023

Suggest an answer

Log in or Sign up to answer