0
請解釋我必須做什麼來關閉JIRA中的門票。我嘗試了很多變體,但沒有人幫助我。 有我的例子:通過JIRA中的groovy關閉門票
import org.apache.log4j.Category
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.jql.builder.JqlQueryBuilder
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.IssueInputParameters
import java.util.Date
import java.util.Calendar
import com.atlassian.jira.bc.JiraServiceContextImpl
import com.atlassian.jira.web.bean.PagerFilter
import com.atlassian.jira.issue.Issue
import java.util.List
def Category log = Category.getInstance("com.onresolve.jira.groovy.PostFunction")
log.setLevel(org.apache.log4j.Level.DEBUG)
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def ctx = new JiraServiceContextImpl(user)
def searchRequestService = ComponentManager.getInstance().getSearchRequestService()
def searchProvider = ComponentManager.getInstance().getSearchProvider()
def sr = searchRequestService.getFilter(ctx, 17540)
def searchResult = searchProvider.search(sr?.getQuery(), user, PagerFilter.getUnlimitedFilter())
def issueManager = ComponentManager.getInstance().getIssueManager()
def issues = searchResult.getIssues().collect {issueManager.getIssueObject(it.id)}
for (issue in issues){
def id=issue.getId()
}
return issues
它的工作正常。它會從篩選器中獲得所有問題,並顯示我或id或名稱,例如我不會。 需要在這個腳本中插入什麼,他們關閉了什麼?我的意思是改變狀態到已解決。
謝謝,你。