任务运行时,Jira,Scriptrunner发送带有某些附件的电子邮件

时间:2019-06-18 15:05:11

标签: groovy jira

在任务转换为特定状态后,我尝试使用jira的scriptrunner发送自定义电子邮件。另外,我想将该任务的附件添加到电子邮件中,但是,不是所有附件,而是仅匹配特定条件的附件,如下所示:

{MailAttachment a ->
   log.warn("This is a test")
   def issueManager = ComponentAccessor.getIssueManager()
   def customFieldManager = ComponentAccessor.getCustomFieldManager()
   def cFieldAttachments = customFieldManager.getCustomFieldObject("customfield_12300")

   log.warn(attachmentsToSend*.getId().contains(a.getId()))
   def issue = a.getIssue()
   def attachmentsToSend = cFieldAttachments.getValue(issue)
   attachmentsToSend*.getId().contains(a.getId()) //<-- Only if this evaluates to true, I want to include the attachment
}

为了只包括我想要的附件,我将上面的代码片段添加为Custom attachment callback(添加了显示此内容的屏幕截图)。

不幸的是,这似乎根本不起作用,输出中也不显示任何日志消息,也不再接收任何电子邮件。

非常感谢帮助我解决该问题的任何帮助。

enter image description here

0 个答案:

没有答案
相关问题