2

Is there any way to create a filtered view of the FNN "Work in Progress" table?

I have many users that aren't generally working on anything in FogBugz, and a set of core developers that are almost always working on cases. I'd like to be able to manually specify either a user group or an explicit list of users to show in the FNN "Work in Progress" table. All other users would not be shown.

I suspect this could be achieved with a BugMonkey script, but my initial attempts have not been fruitful.

flag

3 Answers

1

This jQuery removes me from the table:

setTimeout(function() {
  $('#staticworkingonData_sortable tr td:first-child')
  .each(function() {
    if ($.trim($(this).text()) == 'Michel de Ruiter')
      $(this).parent().remove();
  });
}, 2000);

You can adapt this to your needs.

link|flag
Thank you, Michel. How do I make this code run only once the table is loaded by fnn_updateContent()? Is there any documentation or tutorial that would answer these questions? – Todd Nov 2 at 20:31
@Todd I added a 2 seconds' timeout, does that help? I'm learning JavaScript/jQuery mainly by changing BugMonkey scripts from this site. – Michel de Ruiter Nov 2 at 23:32
Thanks! Since it didn't fit here, I posted the script I ended up with as a separate answer. – Todd Nov 3 at 17:12
1

With thanks to Michel de Ruiter, here's the full script that I ended up with (with names changed). If anyone has any improvements to offer, please feel free.

if( window.location.href.indexOf("screen=WORKINGON") > 0 )
{
// Start a recurring function that runs every 100 ms and will check your table for content
var TableFormatterInterval = setInterval(FormatTable, 100);
}

// this function will run every time the interval above fires
function FormatTable()
{
  var table = $('#staticworkingonData_sortable');
  if (table.find('tr').length !== 0) // if the table exists and contains rows...
  {
    clearInterval(TableFormatterInterval);
    var non_devs = ['user 1', 'user 2', 'etc']
    $('#staticworkingonData_sortable tr td:first-child')
    .each(function()
    {
      if (non_devs.indexOf($.trim($(this).text()))!=-1)
        $(this).parent().remove();
    });
  }
}
link|flag
Looks great, thanks for posting! – Michel de Ruiter Nov 4 at 13:17
1

I've added the requested feature to the plugin in version 1.3.1.

Enjoy!

link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.