本文整理汇总了Java中com.atlassian.jira.issue.MutableIssue类的典型用法代码示例。如果您正苦于以下问题:Java MutableIssue类的具体用法?Java MutableIssue怎么用?Java MutableIssue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MutableIssue类属于com.atlassian.jira.issue包,在下文中一共展示了MutableIssue类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: execute
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
@Override
public void execute(Map transientVars, Map args, PropertySet ps) throws WorkflowException {
MutableIssue issue = getIssue(transientVars);
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 ex;
}
}
开发者ID:AndreyVMarkelov,项目名称:jira-groovioli,代码行数:20,代码来源:GroovioliFunction.java
示例2: fixIssueAssignment
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
private void fixIssueAssignment(final NotificationEvent notificationEvent, final EventData eventData, final IssueResult result) {
final MutableIssue issue = result.getIssue();
if (issue.getAssignee() == null) {
logger.debug("Created issue " + issue.getKey() + "; Assignee: null");
} else {
logger.debug("Created issue " + issue.getKey() + "; Assignee: " + issue.getAssignee().getName());
}
final String assigneeId = eventData.getJiraIssueAssigneeUserId();
if ((assigneeId == null) && (issue.getAssigneeId() != null)) {
logger.debug("Issue needs to be UNassigned");
assignIssue(issue, notificationEvent, eventData);
} else if ((assigneeId != null) && (!issue.getAssigneeId().equals(assigneeId))) {
final String errorMessage = "Issue assignment failed";
logger.error(errorMessage);
jiraSettingsService.addHubError(errorMessage, eventData.getHubProjectName(), eventData.getHubProjectVersion(), eventData.getJiraProjectName(), eventData.getJiraAdminUsername(), eventData.getJiraIssueCreatorUsername(),
"fixIssueAssignment");
} else {
logger.debug("Issue assignment is correct");
}
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:21,代码来源:JiraIssueHandler.java
示例3: assignIssue
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
private void assignIssue(final MutableIssue issue, final NotificationEvent notificationEvent, final EventData eventData) {
final ApplicationUser user = jiraContext.getJiraIssueCreatorUser();
final String assigneeId = eventData.getJiraIssueAssigneeUserId();
final AssignValidationResult assignValidationResult = jiraServices.getIssueService().validateAssign(user, issue.getId(), assigneeId);
final ErrorCollection errors = assignValidationResult.getErrorCollection();
if (assignValidationResult.isValid() && !errors.hasAnyErrors()) {
logger.debug("Assigning issue to user ID: " + assigneeId);
jiraServices.getIssueService().assign(user, assignValidationResult);
updateIssue(issue, assignValidationResult, user, assigneeId);
} else {
final StringBuilder sb = new StringBuilder("Unable to assign issue ");
sb.append(issue.getKey());
sb.append(": ");
for (final String errorMsg : errors.getErrorMessages()) {
sb.append(errorMsg);
sb.append("; ");
}
final String errorMessage = sb.toString();
logger.error(errorMessage);
jiraSettingsService.addHubError(errorMessage, eventData.getHubProjectName(), eventData.getHubProjectVersion(), eventData.getJiraProjectName(), eventData.getJiraAdminUsername(), eventData.getJiraIssueCreatorUsername(),
"assignIssue");
}
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:24,代码来源:JiraIssueHandler.java
示例4: getValidActions
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
private Collection<ValidatedAction> getValidActions(
Collection<ActionDescriptor> actionsToValidate,
ApplicationUser user,
MutableIssue issue,
IssueInputParameters parameters,
String comment) {
Collection<ValidatedAction> validations =
new ArrayList<ValidatedAction>();
for (ActionDescriptor ad : actionsToValidate) {
IssueInputParametersImpl input = new IssueInputParametersImpl();
if (comment != null) {
input.setComment(comment);
}
IssueService.TransitionValidationResult validation =
issueService.validateTransition(user, issue.getId(), ad.getId(), input);
if (validation.isValid()) {
validations.add(new ValidatedAction(ad, validation));
}
}
return validations;
}
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:23,代码来源:TransitionHandler.java
示例5: handle
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
@Override
public Either<CommitHookHandlerError, Comment> handle(ApplicationUser user, MutableIssue issue, String commandName, List<String> args, Date commitDate)
{
final CommentService.CommentParameters commentParameters = CommentService.CommentParameters.builder()
.issue(issue)
.body(args.isEmpty() ? null : args.get(0))
.created(commitDate)
.build();
final CommentService.CommentCreateValidationResult validationResult = commentService.validateCommentCreate(user, commentParameters);
if (validationResult.isValid())
{
return Either.value(commentService.create(user, validationResult, true));
}
else
{
return Either.error(CommitHookHandlerError.fromErrorCollection(
CMD_TYPE.getName(), issue.getKey(), validationResult.getErrorCollection()));
}
}
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:22,代码来源:CommentHandler.java
示例6: testFindCommitInLogEntriesForProject
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
/**
* Tests that we find a particular commit in the log entries for a project.
*
* @param user
* @param issue
* @throws IndexException
* @throws URISyntaxException
* @throws RepositoryException
* @throws IOException
*/
@SuppressWarnings("deprecation")
@Test
public void testFindCommitInLogEntriesForProject(final User user, final MutableIssue issue) throws IndexException, URISyntaxException, RepositoryException, IOException {
new NonStrictExpectations() {{
issueManager.getIssueObject(anyString); result = issue;
permissionManager.hasPermission(Permissions.VIEW_VERSION_CONTROL, withAny(issue), user); result = true;
changeHistoryManager.getPreviousIssueKeys(anyLong); result = new ArrayList<String>();
repositoryManager.parseRepositoryId("id"); result = "id"; minTimes = 1;
repositoryManager.getRepository("id"); result = new GitRepository("id"); minTimes = 1;
}};
// Create the index for the test repository
testIndex();
// Look for a particular commit
final Iterator<LogEntry<GitRepository, GitCommitKey>> logEntries =
commitIndexer.getAllLogEntriesByProject("GCV", user, 0, 5, false).iterator();
Assert.assertTrue("Expected to find marker commit in history", hasCommit("095014f90aac621901d29e1e3986ad5f9e52361a", logEntries));
}
开发者ID:astralbat,项目名称:gitcommitviewer,代码行数:30,代码来源:GitCommitIndexerTest.java
示例7: testFindCommitInLogEntriesForVersion
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
/**
* Tests that we find a particular commit in the log entries for a version.
*
* @param version
* @param user
* @param issue
* @throws IndexException
* @throws URISyntaxException
* @throws RepositoryException
* @throws IOException
*/
@SuppressWarnings("deprecation")
@Test
public void testFindCommitInLogEntriesForVersion(final Version version, final User user, final MutableIssue issue) throws IndexException, URISyntaxException, RepositoryException, IOException {
new NonStrictExpectations() {{
versionManager.getIssuesWithFixVersion(version); result = Arrays.asList(new Issue[] { issue });
issueManager.getIssueObject(anyString); result = issue;
issue.getKey(); result = "GCV-1";
permissionManager.hasPermission(Permissions.VIEW_VERSION_CONTROL, withAny(issue), user); result = true;
changeHistoryManager.getPreviousIssueKeys(anyLong); result = new ArrayList<String>();
repositoryManager.parseRepositoryId("id"); result = "id"; minTimes = 1;
repositoryManager.getRepository("id"); result = new GitRepository("id"); minTimes = 1;
}};
// Create the index for the test repository
testIndex();
// Look for a particular commit
final Iterator<LogEntry<GitRepository, GitCommitKey>> logEntries =
commitIndexer.getAllLogEntriesByVersion(version, user, 0, 5, false).iterator();
Assert.assertTrue("Expected to find marker commit in history", hasCommit("095014f90aac621901d29e1e3986ad5f9e52361a", logEntries));
}
开发者ID:astralbat,项目名称:gitcommitviewer,代码行数:33,代码来源:GitCommitIndexerTest.java
示例8: updateIssue
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
private Issue updateIssue(final MutableIssue issueToUpdate, final AssignValidationResult assignValidationResult, final ApplicationUser userMakingChange, final String assigneeId) {
issueToUpdate.setAssigneeId(assigneeId);
final UpdateIssueRequest issueUpdate = UpdateIssueRequest.builder().eventDispatchOption(EventDispatchOption.ISSUE_UPDATED).sendMail(false).build();
logger.debug("Updating issue with assigned user ID: " + assigneeId);
final Issue updatedIssue = jiraServices.getIssueManager().updateIssue(userMakingChange, issueToUpdate, issueUpdate);
return updatedIssue;
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:8,代码来源:JiraIssueHandler.java
示例9: handle
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
@Override
public Either<CommitHookHandlerError, Worklog> handle(ApplicationUser user, MutableIssue issue, String commandName,
List<String> args, Date commitDate)
{
JiraServiceContextImpl jiraServiceContext = new JiraServiceContextImpl(user);
String worklog = args.get(0);
Pair<String, String> durationAndComment = splitWorklogToDurationAndComment(worklog);
WorklogResult result = worklogService.validateCreate(
jiraServiceContext,
WorklogInputParametersImpl.builder().issue(issue)
.timeSpent(durationAndComment.first())
.comment(durationAndComment.second()).startDate(commitDate != null ? commitDate : new Date()).build());
if (!jiraServiceContext.getErrorCollection().hasAnyErrors())
{
return Either.value(worklogService.createAndAutoAdjustRemainingEstimate(jiraServiceContext, result, true));
}
else
{
return Either.error(CommitHookHandlerError.fromErrorCollection(CMD_TYPE.getName(), issue.getKey(),
jiraServiceContext.getErrorCollection()));
}
}
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:30,代码来源:WorkLogHandler.java
示例10: testHandleCommand_ShouldLogWithSuccess
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
@Test
public void testHandleCommand_ShouldLogWithSuccess()
{
MutableIssue sampleIssue = sampleIssue();
handler.handle(sampleUser(), sampleIssue, "time", Arrays.asList("1h 44m"), null);
verify(worklogService).validateCreate(any(JiraServiceContext.class), worklogParamsCaptor.capture());
WorklogInputParametersImpl worklogParams = worklogParamsCaptor.getValue();
assertThat(worklogParams.getTimeSpent()).isEqualTo("1h 44m");
assertThat(worklogParams.getComment()).isEmpty();
assertThat(worklogParams.getIssue()).isEqualTo(sampleIssue);
}
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:16,代码来源:WorkLogHandlerTest.java
示例11: testHandleCommandWithComment_ShouldLogWithSuccess
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
@Test
public void testHandleCommandWithComment_ShouldLogWithSuccess()
{
MutableIssue sampleIssue = sampleIssue();
handler.handle(sampleUser(), sampleIssue, "time", Arrays.asList("2w 3d 1h 44m Total work logged in !!! "), null);
verify(worklogService).validateCreate(any(JiraServiceContext.class), worklogParamsCaptor.capture());
WorklogInputParametersImpl worklogParams = worklogParamsCaptor.getValue();
assertThat(worklogParams.getTimeSpent()).isEqualTo("2w 3d 1h 44m");
assertThat(worklogParams.getComment()).isEqualTo("Total work logged in !!!");
assertThat(worklogParams.getIssue()).isEqualTo(sampleIssue);
}
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:16,代码来源:WorkLogHandlerTest.java
示例12: setDefaultSecurityLevel
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
private void setDefaultSecurityLevel(MutableIssue issue) throws Exception {
GenericValue project = issue.getProject();
if (
// isEnterprise() &&
project != null) {
IssueSecurityLevelManager issueSecurityLevelManager = ManagerFactory.getIssueSecurityLevelManager();
final Long levelId = issueSecurityLevelManager.getSchemeDefaultSecurityLevel(project);
if (levelId != null) {
issue.setSecurityLevel(issueSecurityLevelManager.getIssueSecurity(levelId));
}
}
}
开发者ID:bcopy,项目名称:JMH,代码行数:13,代码来源:AdvancedCreateIssueHandler.java
示例13: addAdjacentNodesToGraph
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
private void addAdjacentNodesToGraph(Graph graph, Long issueId) {
if (!knownIssueIds.contains(issueId)) {
MutableIssue issueObject = issueManager.getIssueObject(issueId);
Node newNode = new Node(issueObject);
knownIssueIds.add(issueId);
graph.addNode(newNode);
}
if (this.includeOutwardLinks) {
for (IssueLink currentOutwardLink : issueLinkManager.getOutwardLinks(issueId)) {
if (includeLink(currentOutwardLink)) {
if (!knownIssueIds.contains(currentOutwardLink.getDestinationId())) {
addAdjacentNodesToGraph(graph, currentOutwardLink.getDestinationId());
}
addLink(graph, currentOutwardLink);
}
}
}
if (this.includeInwardLinks) {
for (IssueLink currentInwardLink : issueLinkManager.getInwardLinks(issueId)) {
if (includeLink(currentInwardLink)) {
if (!knownIssueIds.contains(currentInwardLink.getSourceId())) {
addAdjacentNodesToGraph(graph, currentInwardLink.getSourceId());
}
addLink(graph, currentInwardLink);
}
}
}
}
开发者ID:jeanarcand,项目名称:foresight,代码行数:36,代码来源:GraphBuilder.java
示例14: addLabels
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
public void addLabels(final MutableIssue issue, final List<String> labels) {
for (final String label : labels) {
logger.debug("Adding label: " + label);
jiraServices.getLabelManager().addLabel(jiraContext.getJiraIssueCreatorUser(), issue.getId(), label, false);
}
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:7,代码来源:IssueFieldHandler.java
示例15: migrateIssueToWorkflow
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
@Override
public void migrateIssueToWorkflow(final MutableIssue arg0, final JiraWorkflow arg1, final Status arg2)
throws WorkflowException {
}
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:6,代码来源:WorkflowManagerMock.java
示例16: getAllIssueKeys
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
@Override
public Set<String> getAllIssueKeys(String issueKey)
{
MutableIssue issue = issueManager.getIssueObject(issueKey);
return getAllIssueKeys(issue);
}
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:7,代码来源:IssueAndProjectKeyManagerImpl.java
示例17: processCommands
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
private void processCommands(CommitCommands commands, CommandsResults results, ApplicationUser user)
{
for (CommitCommands.CommitCommand command : commands.getCommands())
{
CommandType commandType = CommandType.getCommandType(command.getCommandName());
//
// init command result
//
CommandResult commandResult = new CommandResult();
results.addResult(command, commandResult);
MutableIssue issue = issueManager.getIssueObject(command.getIssueKey());
if (issue == null)
{
commandResult.addError("Issue has not been found :" + command.getIssueKey());
continue;
}
switch (commandType)
{
// -----------------------------------------------------------------------------------------------
// Log Work
// -----------------------------------------------------------------------------------------------
case LOG_WORK:
Either<CommitHookHandlerError, Worklog> logResult = workLogHandler.handle(user, issue,
command.getCommandName(), command.getArguments(), commands.getCommitDate());
if (logResult.hasError())
{
commandResult.addError(logResult.getError() + "");
}
break;
// -----------------------------------------------------------------------------------------------
// Comment
// -----------------------------------------------------------------------------------------------
case COMMENT:
Either<CommitHookHandlerError, Comment> commentResult = commentHandler.handle(user, issue,
command.getCommandName(), command.getArguments(), commands.getCommitDate());
if (commentResult.hasError())
{
commandResult.addError(commentResult.getError() + "");
}
break;
// -----------------------------------------------------------------------------------------------
// Transition
// -----------------------------------------------------------------------------------------------
case TRANSITION:
Either<CommitHookHandlerError, Issue> transitionResult = transitionHandler.handle(user, issue,
command.getCommandName(), command.getArguments(), commands.getCommitDate());
if (transitionResult.hasError())
{
commandResult.addError(transitionResult.getError() + "");
}
break;
default:
commandResult.addError("Invalid command " + command.getCommandName());
}
}
}
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:63,代码来源:DefaultSmartcommitsService.java
示例18: getActionsForIssue
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
private Collection<ActionDescriptor> getActionsForIssue(MutableIssue issue) {
return workflowManager.getWorkflow(issue).getAllActions();
}
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:4,代码来源:TransitionHandler.java
示例19: sampleIssue
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
private MutableIssue sampleIssue()
{
return mock(MutableIssue.class);
}
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:5,代码来源:WorkLogHandlerTest.java
示例20: mockIssue
import com.atlassian.jira.issue.MutableIssue; //导入依赖的package包/类
private MutableIssue mockIssue(int id, String projectKey, String issueKey)
{
MockIssue issue = new MockIssue(id, issueKey);
issue.setProjectObject(new MockProject(++projectIdSequence, projectKey));
return issue;
}
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:7,代码来源:RestCommitsTest.java
注:本文中的com.atlassian.jira.issue.MutableIssue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论