将监听器组件导入JIRA CLOUD

时间:2018-04-04 09:40:53

标签: plugins cloud jira

我开发了一个监听器插件,可以触发邮件给自定义字段值中填充的外部用户。这个插件是在JIRA服务器中开发的,它有atlassian-plugin.xml。

我正在尝试将此atlassian-plugin.xml转换为atlassian-conect.json文件,以在JIRA Cloud中上传相同的插件,但无法继续使用组件导入和Web资源。

我的 attlassian-plugin.xml

<component-import key="eventPublisher" interface="com.atlassian.event.api.EventPublisher"/>
    <component key="eventListener" class="com.example.tutorial.plugins.IssueCreatedResolvedListener">
        <description>Class that processes the incoming JIRA issue events.</description>
    </component>

IssueCreatedResolvedListener.java

    @EventListener
        public void onIssueEvent(IssueEvent issueEvent) throws GenericEntityException {
        Long eventTypeId = issueEvent.getEventTypeId();
        Issue issue = issueEvent.getIssue();
        CustomField customField = customFieldManager.getCustomFieldObjectByName("Customer Email Address");
        Object customFieldValue = customField.getValue(issue);

if (customFieldValue != null && eventTypeId.equals(EventType.ISSUE_CREATED_ID)) {
    mail.sendEmail(customFieldValue.toString()," test mail from jira"," test mail from jira","text");

}

请帮助我完成将自定义插件上传到jira cloud所涉及的步骤。

谢谢。

0 个答案:

没有答案