Get all branches in excel from Azure Devops

This is the sumary:


// 1. Go to: https://MYCOMPANY.visualstudio.com/UI/_apis/git/repositories/IDREPOSITORY/stats/branches
// You can get the repository id when load branches page in repos section. (See the network in chrome dev tools)


// 2. Set the response in console:

let response = THE_RESPONSE
let branches = response.value;

// BUILD THE TABLE
let table = [];
branches.forEach((branch, index) => {
  table.push({
    branch: response.value[index].name,
    commitsAhead: response.value[index].aheadCount,
    commitsBehind: response.value[index].behindCount,
    author: response.value[index].commit.author.email,
    authorDate: response.value[index].commit.author.date,
    committerDate: response.value[index].commit.committer.date,
    committerEmail: response.value[index].commit.committer.email,
    commitId: response.value[index].commit.commitId,
  });
});

//3. Print the table and copy and paste in excel
console.table(table)


Sean felices! :) Y siéntanse libres de opinar ;)

No hay comentarios:

Publicar un comentario