Skip to content

Instantly share code, notes, and snippets.

@bit-dragon
Last active August 29, 2015 13:57
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bit-dragon/20e8ae2ff26eee952dce to your computer and use it in GitHub Desktop.
Save bit-dragon/20e8ae2ff26eee952dce to your computer and use it in GitHub Desktop.
// Author: Jorge Garcia Miguel
// Script to get tp numbers from Target Process.
//
// INSTRUCTIONS:
//
// Copy and paste this script on web developer tools console and enjoy!.
(function () {
var storiesOrBugs = [],
tp = null;
$('.timeButton').each(function(index, timeElement) {
if (timeElement.value > 0) {
tp = $(timeElement).parent().parent().find('.moreLink').attr('assignableid');
if (tp) { storiesOrBugs.push(tp); }
}
});
console.log(_.uniq(storiesOrBugs).join(', '));
}());
// Also you can use a bookmark with the follow script (Thanks Dany)
javascript:(function () { var storiesOrBugs = [], tp = null; $('.timeButton').each(function(index, timeElement) { if (timeElement.value > 0) { tp = $(timeElement).parent().parent().find('.moreLink').attr('assignableid'); if (tp) { storiesOrBugs.push(tp); } } }); alert(_.uniq(storiesOrBugs).join(', '));}());
@coolpistachio
Copy link

Hey Jorge, I believe there's a little bug in the current code:

console.log(_.uniq(tps).join(', '));

shouldn't be...

console.log(_.uniq(storiesOrBugs).join(', ')); ??

Regards,
Serch

@bit-dragon
Copy link
Author

Thanks Serch... It was fixed.

@dvarelap
Copy link

If you add it as a bookmark with a little change

alert(_.uniq(storiesOrBugs).join(', '));

instead of

console.log(_.uniq(storiesOrBugs).join(', '));

you don't even have to open web developer tools console.

here's my bookmark script:

javascript:(function () {    var storiesOrBugs = [],    tp = null;     $('.timeButton').each(function(index, timeElement) {        if (timeElement.value > 0) {            tp = $(timeElement).parent().parent().find('.moreLink').attr('assignableid');            if (tp) { storiesOrBugs.push(tp); }        }    }); alert(_.uniq(storiesOrBugs).join(', '));}());

@bit-dragon
Copy link
Author

Thank for that suggestion Dany 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment