code: private void addChangeSet(Build build, JSONObject changeSet, Set<String> commitIds, Set<String> revisions) {        
          String scmType = getString(changeSet, "kind");
          Map<String, RepoBranch> revisionToUrl = new HashMap<>();
  
          // Build a map of revision to module (scm url). This is not always
          // provided by the Hudson API, but we can use it if available.
          // For git, this map is empty.
          for (Object revision : getJsonArray(changeSet, "revisions")) {
              JSONObject json = (JSONObject) revision;
              String revisionId = json.get("revision").toString();
              if (StringUtils.isNotEmpty(revisionId) && !revisions.contains(revisionId)) {
                  RepoBranch rb = new RepoBranch();
                  rb.setUrl(getString(json, "module"));
                  rb.setType(RepoBranch.RepoType.fromString(scmType));
                  revisionToUrl.put(revisionId, rb);
                  build.getCodeRepos().add(rb);
              }
          }
  
          for (Object item : getJsonArray(changeSet, "items")) {
              JSONObject jsonItem = (JSONObject) item;
              String commitId = getRevision(jsonItem);
              if (StringUtils.isNotEmpty(commitId) && !commitIds.contains(commitId)) {
                  SCM scm = new SCM();
                  scm.setScmAuthor(getCommitAuthor(jsonItem));
                  scm.setScmCommitLog(getString(jsonItem, "msg"));
                  scm.setScmCommitTimestamp(getCommitTimestamp(jsonItem));
                  scm.setScmRevisionNumber(commitId);
                  RepoBranch repoBranch = revisionToUrl.get(scm.getScmRevisionNumber());
                  if (repoBranch != null) {
                      scm.setScmUrl(repoBranch.getUrl());
                      scm.setScmBranch(repoBranch.getBranch());
                  }
      
                  scm.setNumberOfChanges(getJsonArray(jsonItem, "paths").size());
                  build.getSourceChangeSet().add(scm);
                  commitIds.add(commitId);
              }
          }
      }
docs: Grabs changeset information for the given build.
  
  @param build     a Build
  @param changeSet the build JSON object
  @param commitIds the commitIds
  @param revisions the revisions