- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们在 Jira 中有一个项目,我们将其用作电子邮件收件箱。并非所有发送电子邮件的人都是 JIRA 的用户(他们也不应该是)。尽管如此,我们还是想在收到电子邮件后通知您。电子邮件地址是问题描述的一部分。
我知道有一些插件,但我不是替换邮件处理程序,而是尝试编写一个用于 JIRA 适应的常规脚本 this code我想将其发布到工作流程的 CREATE 转换上的后函数中。
当我抓取现有的测试问题并在控制台中运行脚本时,以下代码工作正常:
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.mail.Email
import com.atlassian.mail.server.MailServerManager
import com.atlassian.mail.server.SMTPMailServer
ComponentManager componentManager = ComponentManager.getInstance()
MailServerManager mailServerManager = componentManager.getMailServerManager()
SMTPMailServer mailServer = mailServerManager.getDefaultSMTPMailServer()
if (mailServer) {
if (true) {
IssueManager issueManager = componentManager.getIssueManager()
Issue issue = issueManager.getIssueObject("IN-376")
def grabEmail = {
(((it.split( "\\[Created via e-mail received from:")[1]).split("<")[1]).split(">")[0])
}
String senderAddress = grabEmail("${issue.description}")
Email email = new Email(senderAddress)
email.setSubject("JIRA Ticket erstellt: ${issue.summary}")
String content = "Content ----> by Issue2 ${issue.description}"
email.setBody(content)
mailServer.send(email)
}
}
唉,它不会像这样在 Post 函数中运行:
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.Issue
//import com.atlassian.jira.issue.IssueManager
import com.atlassian.mail.Email
import com.atlassian.mail.server.MailServerManager
import com.atlassian.mail.server.SMTPMailServer
ComponentManager componentManager = ComponentManager.getInstance()
MailServerManager mailServerManager = componentManager.getMailServerManager()
SMTPMailServer mailServer = mailServerManager.getDefaultSMTPMailServer()
if (mailServer) {
if (true) {
//IssueManager issueManager = componentManager.getIssueManager()
//Issue issue = issueManager.getIssueObject("IN-376")
def grabEmail = {
(((it.split( "\\[Created via e-mail received from:")[1]).split("<")[1]).split(">")[0])
}
String senderAddress = grabEmail("${issue.description}")
Email email = new Email(senderAddress)
email.setSubject("JIRA Ticket erstellt: ${issue.summary}")
String content = "Content ----> by Issue2 ${issue.description}"
email.setBody(content)
mailServer.send(email)
}
}
我不知道为什么第二个代码会中断,因为它所基于的代码也使用了问题,就好像它是隐式定义的一样。此 Post 函数是最后运行的。
我还发现有关调试此问题的提示很有帮助。
谢谢!
最佳答案
我将发布我的评论作为答案:那么我在任何日志中都没有发现错误。也许是我监督了它,抱歉,但我现在已经更改了很多配置(安装 JEMH 试用版),所以我无法重现。奇怪的是,消息现在就发送了,所以我有一种不好的感觉,我在通知方案中的一些配置错误。
感谢大家的帮助和时间。
关于email - Jira Script Runner - 创建转换的 Post 功能不发送邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31297301/
我在自己的 ubuntu 服务器上有一个简单的 gitlab-runner 设置。它是使用以下方式注册的: sudo gitlab-runner register -n --url https://g
我的 flutter 项目不适用于 ios 设备。 我试过下面的命令sudo gem install cocoapods . flutter 跑: Warning: CocoaPods not ins
我有一个包含2 个作业的管道。 我在 windows 上使用 Debug模式以 super 用户身份启动用户并收到下一个输出: Checking for jobs... received
当我尝试构建我的应用程序时,我在控制台中收到此错误: Xcode build done. 114,3s Failed
我试图让 Karma runner 在 Jenkins 构建期间生成 cobertura 格式的代码覆盖率报告。我可以让它生成一个coverage.xml 文件,但它实际上没有任何覆盖数据。似乎(使用
我正在使用 Windows 10 并使用 Gitlab's doc 安装了 gitlab-runner . 成功安装和注册后,我尝试离开我用来安装的文件夹(C:\Gitlab-Runner 在我的实例
我正在使用 Windows 10 并使用 Gitlab's doc 安装了 gitlab-runner . 成功安装和注册后,我尝试离开我用来安装的文件夹(C:\Gitlab-Runner 在我的实例
我正在尝试创建一个 kubernetes gitlab 运行程序,但遇到了非常普遍的错误 Failed to register the runner. You may be having networ
我曾经在 github 上有一个项目 travis和一个 appveyor已配置集成服务。因此,我能够确保我的项目在 OSX 和 Windows 平台上都可以正常编译。 我现在正在使用 gitlab
在我们的 Gitlab 服务器上,我有两个存储库,其中一个存储库('EPSILON-SDK-C')是另一个存储库中的子模块。当我在我的开发人员机器上本地运行 gitlab-runner sudo g
我正在使用带有 docker+machine 执行程序的 gitlab 运行程序来启动 AWS 上的自动缩放运行程序。我想在运行者中使用 docker-in-docker setup 来构建容器,但我
关于announcement关于 SonarQube 与 MSBuild 和 Team Build 的集成,谁能就 SonarQube Runner 和 SonarQube.MSBuild.Runne
我正在尝试使用带有 shell 执行程序的 gitlab-runner 提取代码。 $ git pull origin master error: cannot open .git/FETCH_H
我正在尝试对远程 Weblogic 12.1.x 进行非常简单的 Arquillian 测试,例如我有以下内容 public class MyBean { } 然后是测试 @RunWith(Arqui
我的环境是 Centos 7,我刚刚安装了 gitlab-runner,当我以安装 gitlab-runner 的用户身份运行此命令时(不是以 root 身份) sudo gitlab-runner
我的环境是 Centos 7,我刚刚安装了 gitlab-runner,当我以安装 gitlab-runner 的用户身份运行此命令时(不是以 root 身份) sudo gitlab-runner
我正在尝试在 Android Studio 中运行仪器测试。 我已经研究并尝试了很多,但我无法克服这个错误消息。 我的模块依赖: (编译) +--- com.crashlytics.sdk.andro
我正在尝试执行我的以下测试套件: import unittest from Login_Page import LoginPageAndLogout def test_suite(): # g
我刚刚使用来自 sonarqube.com 的指南在 Windows 7 上安装了 sonnar runner 我在C盘安装了sonnarqube4.5和sonar-runner,但是我的项目在D盘的
我使用 Dataflow 运行程序测试了我的代码,但它返回错误: > Error message from worker: java.lang.RuntimeException: > org.apac
我是一名优秀的程序员,十分优秀!