Created
May 31, 2013 18:59
-
-
Save RyanHirsch/5687137 to your computer and use it in GitHub Desktop.
Parse the scrumboard....
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
var ScrumBoard = {}; | |
ScrumBoard.title = $('.initTitle').text(); | |
ScrumBoard.currentSprint = $('#sprintNumSpan').text().substring(8); | |
ScrumBoard.profilePicSrc = function(username, passedInDomain) { | |
var domain = passedInDomain || "DEFAULT_DOMAIN"; | |
return "http://SHAREPOINT_MYSITE_URL/User%20Photos/Profile%20Pictures/" + domain + "_" + username + "_LThumb.jpg"; | |
}; | |
ScrumBoard.columns = []; | |
$('.storyColumns').each(function(idx, column) { | |
var columnObj = { | |
tasks: [] | |
}; | |
columnObj.title = $('.pageAndColumnTitles', column).text(); | |
var $tasks = $('.task.text', column); | |
$tasks.each(function(idx, itm) { | |
var titleParse = $('.title>a', itm).text().match(/^#(\d+) (.*) \((\w+)\)$/); | |
var assignedParse = $('.assignedInfo', itm).text().match(/^Assigned: (.*) - (.*)$/); | |
var story = $('.taskParents a', itm).text(); | |
var capability = $('.capabilityInNote a', itm).text(); | |
var description = $('.notes', itm).text().substring(13); | |
columnObj.tasks.push({ | |
id: titleParse[1], | |
title: titleParse[2], | |
priority: titleParse[3], | |
description: description, | |
story: story, | |
capability: capability, | |
assignedTo: assignedParse[1], | |
assignedDate: new Date(assignedParse[2]) | |
}); | |
}); | |
ScrumBoard.columns.push(columnObj); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment