Created
July 3, 2017 10:29
-
-
Save peterfication/648930840edcf5c56b8ab03afad631e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Analyze asana task export in JS console | |
// Format of a task title has to be "[estimated amount of time] title (Actual time used for the task)" | |
// It prints out the average deviation of the estimated time | |
// Open the export JSON in Chrome and run this script in the browser console | |
if (typeof(x) === 'undefined') { | |
const x = JSON.parse($('pre').innerHTML) | |
} | |
var differences = [] | |
for (let task of x.data) { | |
var name = task.name | |
if (name.startsWith('[') && name.endsWith(')')) { | |
const estimated = parseFloat(name.substring(1, name.indexOf(']'))) | |
const actual = parseFloat(name.substring(name.lastIndexOf('(') + 1, name.lastIndexOf(')'))) | |
const difference = estimated - actual | |
// console.log(task.name, estimated, actual, difference) | |
differences.push(difference) | |
} | |
} | |
// console.log(differences) | |
var sum = differences.reduce(function(a, b) { return a + b }) | |
var avg = sum / differences.length | |
console.log(avg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment