mybug.pl

This perl scripts will display the Priority 1 – 3 issues that are assigned to you. You do not have to login to OpenSSO website to check your issues.

#!/usr/bin/perl -w

use strict;
use warnings;
use LWP::UserAgent;

if ($#ARGV != 0) {
    die "Usage: mybug.pl <userid>\n";
}

my $userid = $ARGV[0];

my $url = 'https://opensso.dev.java.net/issues/buglist.cgi?Submit+query=Submit+query&component=opensso&issue_status=NEW&issue_status=STARTED&issue_status=REOPENED&version=current&email1=' . $userid .'&emailtype1=exact&emailassigned_to1=1&email2=&emailtype2=exact&emailreporter2=1&issueidtype=include&issue_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=fulltext&long_desc=&long_desc_type=fulltext&issue_file_loc=&issue_file_loc_type=fulltext&status_whiteboard=&status_whiteboard_type=fulltext&keywords=&keywords_type=anytokens&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&namedcmd=Assigned+Issues&newqueryname=&order=Reuse+same+sort+as+last+time';

my $ua = LWP::UserAgent->new;
my $response = $ua->get( $url );

$response->is_success or
    die "Failed to GET '$url': ", $response->status_line;

my $content = $response->as_string;

while ($content =~ /<a href="show_bug.cgi\?id=\d+?">(\d+?)<\/a>\s+?<\/td>\s+?<td class="red"><span class="issue_type">(.+?)<\/span>\s+?<\/td>\s+?<td class="red"><span class="priority">(.+?)<\/span>\s+?<\/td>\s+?<td class="red"><span class="platform">.+?<\/span>\s+?<\/td>\s+?<td class="red"><span class="owner">(.+?)<\/span>\s+?<\/td>\s+?<td class="red"><span class="status">(.+?)<\/span>\s+?<\/td>\s+?<td class="red"><span class="resolution">.*?<\/span>\s+?<\/td>\s+?<td class="red"><span class="summary">(.+?)<\/span>/gs) {
    my $bugid = $1;
    my $type = $2;
    my $priority = $3;
    my $owner = $4;
    my $status = $5;
    my $summary = $6;

    print "$bugid $type $priority $status\n";
    print "$summary\n\n";

}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: