• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IssueEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.atlassian.jira.event.issue.IssueEvent的典型用法代码示例。如果您正苦于以下问题:Java IssueEvent类的具体用法?Java IssueEvent怎么用?Java IssueEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IssueEvent类属于com.atlassian.jira.event.issue包,在下文中一共展示了IssueEvent类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onIssueEvent

import com.atlassian.jira.event.issue.IssueEvent; //导入依赖的package包/类
@EventListener
public void onIssueEvent(final IssueEvent issueEvent) {
    try {
        final Long eventTypeID = issueEvent.getEventTypeId();
        final Issue issue = issueEvent.getIssue();

        if (!eventTypeID.equals(EventType.ISSUE_CREATED_ID)) {
            logger.debug("=== ISSUE EVENT ===");
            logger.debug(String.format("Event Type ID:    %s", eventTypeID));
            logger.debug(String.format("Issue:            %s", issue));

            final String propertyKey = hubIssueTrackerPropertyHandler.createEntityPropertyKey(issue);
            final EntityProperty hubIssueUrlProperty = getHubIssueTrackerUrlProperty(propertyKey, issue);

            if (hubIssueUrlProperty == null) {
                logger.debug(String.format("Hub Issue Tracker URL not present. No further processing for issue: %s", issue));
            } else {
                final PluginSettings settings = pluginSettingsFactory.createGlobalSettings();
                executorService.submit(createTask(issue, eventTypeID, jiraServices, settings, propertyKey, hubIssueUrlProperty));
            }
        }
    } catch (final Exception ex) {
        logger.error("An unexpected error occurred processing issue event ", ex);
    }
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:26,代码来源:IssueEventListener.java


示例2: assertIssueCreated

import com.atlassian.jira.event.issue.IssueEvent; //导入依赖的package包/类
private void assertIssueCreated(final Long eventTypeId) {
    final Issue issue = createValidIssue();
    final IssueEvent event = createIssueEvent(issue, eventTypeId);
    listener.onIssueEvent(event);

    assertFalse(issueServiceMock.issueMap.isEmpty());

    final IssueView hubIssue = issueServiceMock.issueMap.get(ISSUE_URL);

    final SimpleDateFormat dateFormatter = new SimpleDateFormat(RestConnection.JSON_DATE_FORMAT);
    dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
    final String expectedCreatedAt = dateFormatter.format(issue.getCreated());
    final String expectedUpdatedAt = dateFormatter.format(issue.getUpdated());

    assertEquals(issue.getKey(), hubIssue.issueId);
    assertEquals(issue.getDescription(), hubIssue.issueDescription);
    assertEquals(issue.getStatus().getName(), hubIssue.issueStatus);
    assertEquals(expectedCreatedAt, hubIssue.issueCreatedAt);
    assertEquals(expectedUpdatedAt, hubIssue.issueUpdatedAt);
    assertEquals(issue.getAssignee().getDisplayName(), hubIssue.issueAssignee);
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:22,代码来源:IssueEventListenerTest.java


示例3: testEmptyProjectMapping

import com.atlassian.jira.event.issue.IssueEvent; //导入依赖的package包/类
@Test
public void testEmptyProjectMapping() {
    final Issue issue = createIssue(new Long(1), new Long(1), JIRA_PROJECT_NAME, new StatusMock(), new ApplicationUserMock());
    final IssueEvent event = createIssueEvent(issue, EventType.ISSUE_UPDATED_ID);
    listener.onIssueEvent(event);
    assertTrue(issueServiceMock.issueMap.isEmpty());
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:8,代码来源:IssueEventListenerTest.java


示例4: onIssueEvent

import com.atlassian.jira.event.issue.IssueEvent; //导入依赖的package包/类
@EventListener
public void onIssueEvent(IssueEvent issueEvent) {
    Issue issue = issueEvent.getIssue();
    if (issue != null) {
        String eventType = "";
        try {
            eventType = eventTypeManager.getEventType(issueEvent.getEventTypeId()).getName();
        } catch (IllegalArgumentException e) {
        }
        eventTypeManager.getEventType(issueEvent.getEventTypeId());
        metricCollector.issueUpdateCounter(issue.getProjectObject().getKey(), issue.getKey(), eventType, getCurrentUser());
    }
}
 
开发者ID:AndreyVMarkelov,项目名称:jira-prometheus-exporter,代码行数:14,代码来源:MetricListener.java


示例5: testCreatedEventId

import com.atlassian.jira.event.issue.IssueEvent; //导入依赖的package包/类
@Test
public void testCreatedEventId() {
    final Issue issue = createIssue(new Long(1), new Long(1), JIRA_PROJECT_NAME, new StatusMock(), new ApplicationUserMock());
    final IssueEvent event = createIssueEvent(issue, EventType.ISSUE_CREATED_ID);
    listener.onIssueEvent(event);
    assertTrue(issueServiceMock.issueMap.isEmpty());
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:8,代码来源:IssueEventListenerTest.java


示例6: testOldHubVersion

import com.atlassian.jira.event.issue.IssueEvent; //导入依赖的package包/类
@Test
public void testOldHubVersion() {
    final VersionComparison versionComparison = new VersionComparison();
    versionComparison.consumerVersion = "3.7.0";
    versionComparison.producerVersion = "3.6.0";
    versionComparison.numericResult = 1;
    versionComparison.operatorResult = ">";
    versionRequestServiceMock.setHubVersionComparison(versionComparison);
    final Issue issue = createIssue(new Long(1), new Long(1), JIRA_PROJECT_NAME, new StatusMock(), new ApplicationUserMock());
    final IssueEvent event = createIssueEvent(issue, EventType.ISSUE_UPDATED_ID);
    listener.onIssueEvent(event);
    assertTrue(issueServiceMock.issueMap.isEmpty());
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:14,代码来源:IssueEventListenerTest.java


示例7: testEventType

import com.atlassian.jira.event.issue.IssueEvent; //导入依赖的package包/类
@Test
public void testEventType() {
    final Issue issue = createIssue(new Long(1), new Long(1), JIRA_PROJECT_NAME, new StatusMock(), new ApplicationUserMock());
    final IssueEvent event = createIssueEvent(issue, EventType.ISSUE_UPDATED_ID);
    listener.onIssueEvent(event);
    assertTrue(issueServiceMock.issueMap.isEmpty());
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:8,代码来源:IssueEventListenerTest.java


示例8: testUpdateEventWithJiraProjectNotMapped

import com.atlassian.jira.event.issue.IssueEvent; //导入依赖的package包/类
@Test
public void testUpdateEventWithJiraProjectNotMapped() {
    populateProjectSettings();
    final Issue issue = createIssue(new Long(1), new Long(999), JIRA_PROJECT_NAME, new StatusMock(), new ApplicationUserMock());
    final IssueEvent event = createIssueEvent(issue, EventType.ISSUE_UPDATED_ID);
    listener.onIssueEvent(event);
    assertTrue(issueServiceMock.issueMap.isEmpty());
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:9,代码来源:IssueEventListenerTest.java


示例9: testUpdateEventWithNullEntityProperty

import com.atlassian.jira.event.issue.IssueEvent; //导入依赖的package包/类
@Test
public void testUpdateEventWithNullEntityProperty() {
    populateProjectSettings();
    final Issue issue = createIssue(new Long(1), JIRA_PROJECT_ID, JIRA_PROJECT_NAME, new StatusMock(), new ApplicationUserMock());
    final IssueEvent event = createIssueEvent(issue, EventType.ISSUE_UPDATED_ID);
    listener.onIssueEvent(event);
    assertTrue(issueServiceMock.issueMap.isEmpty());
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:9,代码来源:IssueEventListenerTest.java


示例10: testDeleteEventWithEntityProperty

import com.atlassian.jira.event.issue.IssueEvent; //导入依赖的package包/类
@Test
public void testDeleteEventWithEntityProperty() {
    populateProjectSettings();
    createEntityProperty();

    final StatusMock status = new StatusMock();
    status.setName(STATUS_NAME);
    final ApplicationUserMock assignee = new ApplicationUserMock();
    assignee.setName(ASSIGNEE_USER_NAME);
    final Issue issue = createIssue(new Long(1), JIRA_PROJECT_ID, JIRA_PROJECT_NAME, status, assignee);
    final IssueEvent event = createIssueEvent(issue, EventType.ISSUE_DELETED_ID);

    final SimpleDateFormat dateFormatter = new SimpleDateFormat(RestConnection.JSON_DATE_FORMAT);
    dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
    final String expectedCreatedAt = dateFormatter.format(issue.getCreated());
    final String expectedUpdatedAt = dateFormatter.format(issue.getUpdated());
    final IssueView hubIssue = new IssueView();
    hubIssue.issueId = issue.getKey();
    hubIssue.issueDescription = issue.getDescription();
    hubIssue.issueStatus = issue.getStatus().getName();
    hubIssue.issueCreatedAt = expectedCreatedAt;
    hubIssue.issueUpdatedAt = expectedUpdatedAt;
    hubIssue.issueAssignee = issue.getAssignee().getDisplayName();

    issueServiceMock.issueMap.put(ISSUE_URL, hubIssue);
    listener.onIssueEvent(event);

    assertTrue(issueServiceMock.issueMap.isEmpty());
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:30,代码来源:IssueEventListenerTest.java


示例11: sendIssueEventComment

import com.atlassian.jira.event.issue.IssueEvent; //导入依赖的package包/类
private void sendIssueEventComment(PluginSettings settings, String projectId, String channelName, IssueEvent issueEvent) // {{{
{
	if (issueEvent.getComment() != null && StringUtils.isNotBlank(issueEvent.getComment().getBody()))
	{
		String comment = StringUtils.abbreviate(issueEvent.getComment().getBody(), 60);
		sendNotification(projectId, channelName, String.format("\"%s\"", comment));
	}
}
 
开发者ID:jmaurice,项目名称:jira-irc-plugin,代码行数:9,代码来源:IrcNotificationPlugin.java


示例12: createIssueEvent

import com.atlassian.jira.event.issue.IssueEvent; //导入依赖的package包/类
private IssueEvent createIssueEvent(final Issue issue, final Long eventTypeId) {
    return new IssueEvent(issue, new HashMap<>(), createApplicationUser(), eventTypeId);
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:4,代码来源:IssueEventListenerTest.java


示例13: assertIssueNotCreated

import com.atlassian.jira.event.issue.IssueEvent; //导入依赖的package包/类
private void assertIssueNotCreated(final Long eventTypeId) {
    final Issue issue = createValidIssue();
    final IssueEvent event = createIssueEvent(issue, eventTypeId);
    listener.onIssueEvent(event);
    assertTrue(issueServiceMock.issueMap.isEmpty());
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:7,代码来源:IssueEventListenerTest.java


示例14: onIssueEvent

import com.atlassian.jira.event.issue.IssueEvent; //导入依赖的package包/类
@EventListener
public void onIssueEvent(IssueEvent issueEvent)
{
    Issue issue = issueEvent.getIssue();
    Comment comment = issueEvent.getComment();
    JamClient jamClient = new JamClient(applicationLinkService, hostApplication, issueManager);

    Long eventTypeId = issueEvent.getEventTypeId();
    String eventBlurb = null;
    if (eventTypeId.equals(EventType.ISSUE_COMMENTED_ID)) {
      // Ignore comments on their own. Non-empty comments are appended to the action
      // at the end of this if block.
    } else if (eventTypeId.equals(EventType.ISSUE_UPDATED_ID) ||
               eventTypeId.equals(EventType.ISSUE_RESOLVED_ID) ||
               eventTypeId.equals(EventType.ISSUE_REOPENED_ID) ||
               eventTypeId.equals(EventType.ISSUE_ASSIGNED_ID) ||
               eventTypeId.equals(EventType.ISSUE_CLOSED_ID) ||
               eventTypeId.equals(EventType.ISSUE_WORKSTOPPED_ID) ||
               eventTypeId.equals(EventType.ISSUE_WORKSTARTED_ID)) {
      List<GenericValue> changeItems = null;
      try {
          GenericValue changeLog = issueEvent.getChangeLog();
          changeItems = changeLog.internalDelegator.findByAnd("ChangeItem", EasyMap.build("group", changeLog.get("id")));
      } catch (GenericEntityException e){
        e.printStackTrace();
      } 

      if (changeItems != null) {
        eventBlurb = "Summary of updated values:\n";
        for (GenericValue genericValue : changeItems) {
          String field = genericValue.getString("field");
          String oldString = genericValue.getString("oldstring");
          String newString = genericValue.getString("newstring");
          String oldId = genericValue.getString("oldvalue");
          String newId = genericValue.getString("newvalue");
          eventBlurb +=
              field + ": <b>" +
              (oldString == null ? " " : oldString) +
              (oldId == null ? "" : "[" + oldId + "]") +
              "</b> to <b>" +
              (newString == null ? " " : newString) +
              (newId == null ? "" : "[" + newId + "]") +
              "</b>\n";
        }
      }
    }

    if (comment != null) {
      if (eventBlurb == null) {
        eventBlurb = comment.getBody();
      } else {
        eventBlurb += "\n" + comment.getBody();
      }
    }

    if (eventBlurb != null) {
      jamClient.postIssueActivity(issue, eventBlurb);
    }
}
 
开发者ID:SAP,项目名称:SAPJamWorkPatternJIRAIntegration,代码行数:60,代码来源:JamEventListener.java



注:本文中的com.atlassian.jira.event.issue.IssueEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SelectionLayer类代码示例发布时间:2022-05-23
下一篇:
Java LexBIGService类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap