我试过这个来添加工作日志:
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.crowd.embedded.api.User;
import com.atlassian.jira.event.type.EventDispatchOption;
import com.atlassian.jira.util.ImportUtils;
import com.atlassian.jira.issue.worklog.WorklogManager;
import com.atlassian.jira.bc.JiraServiceContextImpl;
import com.atlassian.jira.bc.JiraServiceContext;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.bc.issue.worklog.WorklogService;
import com.atlassian.jira.issue.worklog.Worklog;
import com.atlassian.jira.issue.worklog.WorklogImpl;
Boolean condition = false;
issueManager = ComponentAccessor.getIssueManager();
Issue myIssue = issueManager.getIssueObject("GYM-2109");
WorklogManager worklogManager = ComponentAccessor.getWorklogManager();
for(int i=0; i<=4; i++) {
worklog = new WorklogImpl(
worklogManager,
myIssue,
null,
myIssue.reporter.name,
myIssue.summary,
new Date(),
null,
null,
1*3600
)
worklogManager.create(myIssue.reporter, worklog, 0L, false)
}
但实际上,我需要添加计划时间而不是记录。
很抱歉,如果你在代码中看到一些奇怪的东西 - 我是初学者。
我等你的回复。
提前谢谢。