【JIRA】jira issue reindex

参考文档: https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Scriptrunner-Listener-Reindex-Static-Check-error-though-reindex/qaq-p/1590406

import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLink

import com.atlassian.jira.issue.link.IssueLinkType
import com.atlassian.jira.issue.IssueFieldConstants
import com.atlassian.jira.issue.link.IssueLinkManager
import com.atlassian.jira.issue.fields.IssueLinksSystemField
import com.atlassian.jira.event.type.EventDispatchOption

import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.project.version.Version

import com.atlassian.jira.issue.index.IssueIndexingService
import com.atlassian.jira.util.ImportUtils

ApplicationUser currentUser = ComponentAccessor.getJiraAuthenticationContext().loggedInUser

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

def reIndexIssue(Issue issue){
//Re-index the issue after update
boolean wasIndexing = ImportUtils.isIndexIssues()
ImportUtils.setIndexIssues(true)
IssueIndexingService.reIndex(issue)
ImportUtils.setIndexIssues(wasIndexing) }

 

【JIRA】jira issue reindex

上一篇:C#中dll调用方法


下一篇:1036 Boys vs Girls (25 分)