本文整理汇总了Java中com.atlassian.jira.issue.Issue.getKey方法的典型用法代码示例。如果您正苦于以下问题:Java Issue.getKey方法的具体用法?Java Issue.getKey怎么用?Java Issue.getKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.atlassian.jira.issue.Issue
的用法示例。
在下文中一共展示了Issue.getKey方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDelete
import com.atlassian.jira.issue.Issue; //导入方法依赖的package包/类
@Test
public void testDelete() throws Exception {
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 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);
issueHandler.deleteHubIssue(ISSUE_URL, issue);
assertTrue(issueServiceMock.issueMap.isEmpty());
}
示例2: testDeleteEmptyURL
import com.atlassian.jira.issue.Issue; //导入方法依赖的package包/类
@Test
public void testDeleteEmptyURL() throws Exception {
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 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);
issueHandler.deleteHubIssue("", issue);
assertFalse(issueServiceMock.issueMap.isEmpty());
assertNotNull(settings.get(HubJiraConstants.HUB_JIRA_ERROR));
}
示例3: createHubIssueView
import com.atlassian.jira.issue.Issue; //导入方法依赖的package包/类
private IssueView createHubIssueView(final Issue jiraIssue) {
final IssueView hubIssue = new IssueView();
final String issueId = jiraIssue.getKey();
String assignee = "";
if (jiraIssue.getAssignee() != null) {
assignee = jiraIssue.getAssignee().getDisplayName();
} else {
assignee = USER_NOT_ASSIGNED;
}
String status = "";
if (jiraIssue.getStatus() != null) {
status = jiraIssue.getStatus().getName();
}
status = jiraIssue.getStatus().getName();
final String createdAt = dateFormatter.format(jiraIssue.getCreated());
final String updatedAt = dateFormatter.format(jiraIssue.getUpdated());
hubIssue.issueId = issueId;
hubIssue.issueAssignee = assignee;
hubIssue.issueStatus = status;
hubIssue.issueCreatedAt = createdAt;
hubIssue.issueUpdatedAt = updatedAt;
hubIssue.issueDescription = jiraIssue.getSummary();
hubIssue.issueLink = String.format("%s/browse/%s", jiraServices.getJiraBaseUrl(), jiraIssue.getKey());
return hubIssue;
}
示例4: testDeleteEventWithEntityProperty
import com.atlassian.jira.issue.Issue; //导入方法依赖的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());
}
示例5: erstelleWorklogText
import com.atlassian.jira.issue.Issue; //导入方法依赖的package包/类
public String erstelleWorklogText(Worklog worklog)
{
Issue issue = worklog.getIssue();
Issue parent = issue.getParentObject();
String worklogComment = worklog.getComment();
StringBuilder text = new StringBuilder(parent == null ? "" : parent.getKey() + " : ");
text.append(String.format("%s : %s", issue.getKey(), issue.getSummary()));
if ( worklogComment != null && worklogComment.length() > 0) {
text.append(" : ").append(worklogComment);
}
return text.toString();
}