我正在尝试将一些文本连接到用户输入的注解中。我该怎么做呢?下面是我的代码。我需要访问用户输入的注解,然后向其中添加新的文本。我该怎么做呢?我正在使用Jira ScriptRunner自定义后置函数,当用户单击一个过渡时,该后置函数将被执行。
import com.atlassian.jira.issue.comments.Comment
import com.atlassian.jira.workflow.JiraWorkflow
import com.atlassian.jira.workflow.WorkflowManager
import org.apache.log4j.Logger
import com.atlassian.jira.component.ComponentAccessor
def log = Logger.getLogger("atlassian-jira.log")
log.warn("This is the last action ")
WorkflowManager workflowManager = ComponentAccessor.getWorkflowManager();
JiraWorkflow workflow = workflowManager.getWorkflow(issue);
List <Object> actions = workflow.getLinkedStep(issue.getStatus()).getActions();
def wfd = workflow.getDescriptor()
def actionName = wfd.getAction(transientVars["actionId"] as int).getName();
log.warn("This is the last action "+actionName)
def comment= "+++ added via workflow action "+"\""+actionName+"\"+++"
1条答案
按热度按时间jgwigjjp1#
这是代码transientVars是要走的路。