public HashMap findInAudit()

in src/main/java/jetbrains/buildServer/investigationsAutoAssigner/utils/InvestigationsManager.java [127:158]


  public HashMap<Long, User> findInAudit(@NotNull final Iterable<STestRun> sTestRuns, @NotNull SProject project) {
    AuditLogBuilder builder = myAuditLogProvider.getBuilder();
    builder.setActionTypes(ActionType.TEST_MARK_AS_FIXED, ActionType.TEST_INVESTIGATION_ASSIGN);
    List<String> projectIds = collectProjectHierarchyIds(project);
    Set<String> objectIds = new HashSet<>();
    for (STestRun testRun : sTestRuns) {
      for (String projectId : projectIds) {
        objectIds.add(TestId.createOn(testRun.getTest().getTestNameId(), projectId).asString());
      }
    }
    if (objectIds.isEmpty() && TeamCityProperties.getBooleanOrTrue("teamcity.autoAssigner.skipAuditLookupWithoutTests.enabled")) {
      return new HashMap<>();
    }
    builder.setObjectIds(objectIds);
    List<AuditLogAction> lastActions = builder.getLogActions(-1);
    HashMap<Long, User> result = new HashMap<>();
    for (AuditLogAction action : lastActions) {
      for (ObjectWrapper obj : action.getObjects()) {
        Object user = obj.getObject();
        if (!(user instanceof User)) {
          continue;
        }

        TestId testId = TestId.fromString(action.getObjectId());
        if (testId != null) {
          result.putIfAbsent(testId.getTestNameId(), (User)user);
          break;
        }
      }
    }
    return result;
  }