Hello,
i try to write an script that re-index Jira in the Background,
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.task.context.*
import com.atlassian.jira.task.context.Context
import com.atlassian.jira.util.index.IndexLifecycleManager
def indexLifecycleManager = ComponentAccessor.getComponent(IndexLifecycleManager.class)
def context = Context.Builder.build()
indexLifecycleManager.reIndexAllIssuesInBackground(context)
but it's not working.
No signature of method: static com.atlassian.jira.task.context.Context$Builder.build() is applicable for argument types: () values: [] Possible solutions: build(), find(), find(groovy.lang.Closure), split(groovy.lang.Closure), wait(), dump()
I try to google it but don't find anything. Did you guys got an idea what i should add/change?
kind regards
Did this ever get solved?
When I put your code into ScriptRunner's console, I get an error on the
def context = Context.Builder.build()
line saying, "[Static type checking] - Non static method com.atlassian.jira.task.context.Context$Builder#build cannot be called from static context @ line 7, column 15."
I searched for this a while as well but finally made it with:
def context = new Context.Builder().build()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ricardo,
Is there a particular reason you want to write a script to do reindexing in the background, as opposed to the background reindexing provided by JIRA here?
Adam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes we want to schedule the reindex as a jira service and its possible to set a script as a service
Ricardo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.