Package org.sonar.api.issue.internal

Examples of org.sonar.api.issue.internal.IssueChangeContext


        user = userFinder.findByLogin(assignee);
        if (user == null) {
          throw new NotFoundException("Unknown user: " + assignee);
        }
      }
      IssueChangeContext context = IssueChangeContext.createUser(new Date(), UserSession.get().login());
      if (issueUpdater.assign(issue, user, context)) {
        saveIssue(session, issue, context, null);
      }
      return issue;
View Full Code Here


          throw new NotFoundException("Unknown action plan: " + actionPlanKey);
        }
      }
      DefaultIssue issue = getByKeyForUpdate(session, issueKey).toDefaultIssue();

      IssueChangeContext context = IssueChangeContext.createUser(new Date(), UserSession.get().login());
      if (issueUpdater.plan(issue, actionPlan, context)) {
        saveIssue(session, issue, context, null);
      }
      return issue;
View Full Code Here

    DbSession session = dbClient.openSession(false);
    try {
      DefaultIssue issue = getByKeyForUpdate(session, issueKey).toDefaultIssue();
      UserSession.get().checkProjectPermission(UserRole.ISSUE_ADMIN, issue.projectKey());

      IssueChangeContext context = IssueChangeContext.createUser(new Date(), UserSession.get().login());
      if (issueUpdater.setManualSeverity(issue, severity, context)) {
        saveIssue(session, issue, context, null);
      }
      return issue;
    } finally {
View Full Code Here

    }

    DbSession session = dbClient.openSession(false);
    try {
      DefaultIssue issue = issueService.getByKeyForUpdate(session, issueKey).toDefaultIssue();
      IssueChangeContext context = IssueChangeContext.createUser(new Date(), userSession.login());
      updater.addComment(issue, text, context);

      issueService.saveIssue(session, issue, context, text);
      session.commit();
View Full Code Here

    List<Issue> issues = getByKeysForUpdate(issueBulkChangeQuery.issues());
    Referentials referentials = new Referentials(issues);

    List<Action> bulkActions = getActionsToApply(issueBulkChangeQuery, issues, userSession);
    IssueChangeContext issueChangeContext = IssueChangeContext.createUser(new Date(), userSession.login());
    Set<String> concernedProjects = new HashSet<String>();
    for (Issue issue : issues) {
      ActionContext actionContext = new ActionContext(issue, issueChangeContext);
      for (Action action : bulkActions) {
        applyAction(action, actionContext, issueBulkChangeQuery, result);
View Full Code Here

  /**
   * Unplan all issues linked to an action plan
   */
  private void unplanIssues(DefaultActionPlan actionPlan, UserSession userSession) {
    List<IssueDto> dtos = findIssuesByActionPlan(actionPlan.key());
    IssueChangeContext context = IssueChangeContext.createUser(new Date(), userSession.login());
    List<DefaultIssue> issues = newArrayList();
    for (IssueDto issueDto : dtos) {
      DefaultIssue issue = issueDto.toDefaultIssue();
      // Unplan issue
      if (issueUpdater.plan(issue, null, context)) {
View Full Code Here

  @Test
  public void should_update_issues() throws Exception {
    setupData("should_update_issues");

    IssueChangeContext context = IssueChangeContext.createUser(new Date(), "emmerik");

    DefaultIssueComment comment = DefaultIssueComment.create("ABCDE", "emmerik", "the comment");
    // override generated key
    comment.setKey("FGHIJ");
View Full Code Here

    sendNotifications(project);
  }

  private void sendNotifications(Project project) {
    IssuesBySeverity newIssues = new IssuesBySeverity();
    IssueChangeContext context = IssueChangeContext.createScan(project.getAnalysisDate());
    Map<DefaultIssue, Rule> shouldSentNotification = new LinkedHashMap<DefaultIssue, Rule>();
    for (DefaultIssue issue : issueCache.all()) {
      if (issue.isNew() && issue.resolution() == null) {
        newIssues.add(issue);
      }
View Full Code Here

  @Test
  public void should_update_issues() throws Exception {
    setupData("should_update_issues");

    IssueChangeContext context = IssueChangeContext.createUser(new Date(), "emmerik");

    Project project = new Project("struts");
    project.setId(10);
    when(projectTree.getRootProject()).thenReturn(project);
View Full Code Here

TOP

Related Classes of org.sonar.api.issue.internal.IssueChangeContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.