本文整理汇总了Java中com.atlassian.jira.issue.Issue类的典型用法代码示例。如果您正苦于以下问题:Java Issue类的具体用法?Java Issue怎么用?Java Issue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Issue类属于com.atlassian.jira.issue包,在下文中一共展示了Issue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testUpdate
import com.atlassian.jira.issue.Issue; //导入依赖的package包/类
@Test
public void testUpdate() 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);
issueHandler.updateHubIssue(ISSUE_URL, issue);
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);
}
示例2: onIssueEvent
import com.atlassian.jira.issue.Issue; //导入依赖的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);
}
}
示例3: validate
import com.atlassian.jira.issue.Issue; //导入依赖的package包/类
@Override
public void validate(Map transientVars, Map args, PropertySet ps) throws InvalidInputException {
Issue issue = (Issue) transientVars.get("issue");
String script = (String) args.get(FIELD);
Map<String, Object> parameters = new HashMap<>();
parameters.put("issue", issue);
parameters.put("issueImpl", IssueImpl.class.cast(issue));
parameters.put("transientVars", transientVars);
parameters.put("args", args);
parameters.put("ps", ps);
try {
scriptManager.executeScript(script, parameters);
} catch (Exception ex) {
log.error("Error", ex);
throw new InvalidInputException(ex);
}
}
示例4: passesCondition
import com.atlassian.jira.issue.Issue; //导入依赖的package包/类
@Override
public boolean passesCondition(Map transientVars, Map args, PropertySet ps) throws WorkflowException {
Issue issue = getIssue(transientVars);
String script = (String) args.get(GroovioliFunctionFactory.FIELD);
Map<String, Object> parameters = new HashMap<>();
parameters.put("issue", issue);
parameters.put("issueImpl", IssueImpl.class.cast(issue));
parameters.put("transientVars", transientVars);
parameters.put("args", args);
parameters.put("ps", ps);
try {
return (Boolean) scriptManager.executeScript(script, parameters);
} catch (Exception ex) {
log.error("Error", ex);
throw ex;
}
}
示例5: doGet
import com.atlassian.jira.issue.Issue; //导入依赖的package包/类
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
UserProfile userProfile = userManager.getRemoteUser(req);
if (userProfile == null || !userManager.isSystemAdmin(userProfile.getUserKey())) {
redirectToLogin(req, resp);
return;
}
// Render the list of issues
List<Issue> issues = getIssues(req);
log.debug("ISSUES: " + issues);
Map<String, Object> context = Maps.newHashMap();
context.put("issues", issues);
templateRenderer.render(CV_PROFILE_VM_VIEW, context, resp.getWriter());
}
示例6: getIssues
import com.atlassian.jira.issue.Issue; //导入依赖的package包/类
/**
* Returns a list of issues.
*
* @param req
* @return
*/
private List<Issue> getIssues(HttpServletRequest req) {
// User is required to carry out a search
ApplicationUser user = jiraUserManager.getUser(userManager.getRemoteUsername(req));
// search issues
// The search interface requires JQL clause... so let's build one
JqlClauseBuilder jqlClauseBuilder = JqlQueryBuilder.newClauseBuilder();
// Our JQL clause is simple project="TUTORIAL"
com.atlassian.query.Query query = jqlClauseBuilder.project("SKILL").buildQuery();
// A page filter is used to provide pagination. Let's use an unlimited filter to
// to bypass pagination.
PagerFilter pagerFilter = PagerFilter.getUnlimitedFilter();
com.atlassian.jira.issue.search.SearchResults searchResults = null;
try {
// Perform search results
searchResults = searchService.search(user, query, pagerFilter);
}
catch (SearchException e) {
e.printStackTrace();
}
// return the results
return searchResults.getIssues();
}
示例7: createHubIssue
import com.atlassian.jira.issue.Issue; //导入依赖的package包/类
public String createHubIssue(final String hubIssueUrl, final Issue jiraIssue) {
String url = "";
try {
if (StringUtils.isNotBlank(hubIssueUrl)) {
url = issueRequestService.createIssue(createHubIssueView(jiraIssue), hubIssueUrl);
} else {
final String message = "Error creating hub issue; no component or component version found.";
logger.error(message);
jiraSettingsService.addHubError(message, "createHubIssue");
}
} catch (final IntegrationException ex) {
logger.error("Error creating Hub Issue", ex);
jiraSettingsService.addHubError(ex, "createHubIssue");
}
return url;
}
示例8: assertIssueCreated
import com.atlassian.jira.issue.Issue; //导入依赖的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);
}
示例9: testCreate
import com.atlassian.jira.issue.Issue; //导入依赖的package包/类
@Test
public void testCreate() 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);
issueHandler.createHubIssue(ISSUE_URL, issue);
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);
}
示例10: 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());
}
示例11: 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));
}
示例12: testEmptyProjectMapping
import com.atlassian.jira.issue.Issue; //导入依赖的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());
}
示例13: onIssueEvent
import com.atlassian.jira.issue.Issue; //导入依赖的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());
}
}
示例14: onIssueViewEvent
import com.atlassian.jira.issue.Issue; //导入依赖的package包/类
@EventListener
public void onIssueViewEvent(IssueViewEvent issueViewEvent) {
Issue issue = issueManager.getIssueObject(issueViewEvent.getId());
if (issue != null) {
metricCollector.issueViewCounter(issue.getProjectObject().getKey(), issue.getKey(), getCurrentUser());
}
}
示例15: updateHubIssue
import com.atlassian.jira.issue.Issue; //导入依赖的package包/类
public void updateHubIssue(final String hubIssueUrl, final Issue jiraIssue) {
try {
if (StringUtils.isNotBlank(hubIssueUrl)) {
logger.debug(String.format("Updating issue %s from hub for jira issue %s", hubIssueUrl, jiraIssue.getKey()));
issueRequestService.updateIssue(createHubIssueView(jiraIssue), hubIssueUrl);
} else {
final String message = "Error updating hub issue; no component or component version found.";
logger.error(message);
jiraSettingsService.addHubError(message, "updateHubIssue");
}
} catch (final IntegrationException ex) {
logger.error("Error updating Hub Issue", ex);
jiraSettingsService.addHubError(ex, "updateHubIssue");
}
}