Aliaksei Parasiatsyeu
unread,May 21, 2012, 10:27:56 AM5/21/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DevTargetProcess, ni...@epayworldwide.com
I have written a mashup for the Task board, but when I change users
the mashup does not run. It looks like the board is updated via ajax
because the page does not post back. How do write my mashup in a way
that it get's called each time the board is updated? Is it even
possible?
Thanks!
the code:
tau.mashups
.addDependency('libs/jquery/jquery')
.addMashup(function ($, config) {
$('td.userStories.tau-target-box').each(function (i, el) {
var userStoryId = $(this).find('a.tau-entity-id.tau-target-
link').text();
var url = "/api/v1/UserStories/" + userStoryId.toString() +
"/?&format=json&append=[Bugs-Count,Tasks-Count]";
$.getJSON(url, function (data) {
$.each(data.CustomFields, function (i, v) {
if (v.Name == "Expected Completion Date" && v.Value !
= null) {
var date = new Date(parseInt(v.Value.substr(6)));
$(el).find('div:last').after("<div style='font-
size: 14px; color: red; line-height: 18px;'>Expected Completion Date:
" + date.format("m/d/y") + "</div>");
return false; // break loop
}
});
if (data['Tasks-Count'] == 0) {
$(el).css("background-color", "pink");
}
});
});
});