-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathredmine
More file actions
executable file
·52 lines (42 loc) · 1.21 KB
/
redmine
File metadata and controls
executable file
·52 lines (42 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;
use JSON;
use Data::Dumper;
my $pdurbin = 4;
my $leonid = 11;
my $user;
$user = $pdurbin;
#$user = $leonid;
my $base_url = 'https://redmine.hmdc.harvard.edu';
my $issues_json = "$base_url/issues.json?limit=100&assigned_to_id=$user";
my $content = get($issues_json);
die "Couldn't download $issues_json " unless defined $content;
my $data = from_json($content);
for my $i ( sort by_release_then_priority @{ $$data{issues} } ) {
printf(
@ARGV && $ARGV[0] eq '-v'
? "%s %s (%s)\n - %s %s, %s %s, %s\n - %s\n\n"
: "%s %s (%s)\n",
"#$i->{id}",
$i->{subject},
$i->{fixed_version}{name} || '?.?',
"$i->{priority}{name} priority",
lc( $i->{tracker}{name} || '?' ),
lc("$i->{status}{name} for"),
$i->{fixed_version}{name} || '?.?',
"$i->{done_ratio}% done",
"$base_url/issues/$i->{id}",
);
}
sub by_release {
$$a{fixed_version}{name} cmp $$b{fixed_version}{name};
}
sub by_priority {
$$b{priority}{id} <=> $$a{priority}{id};
}
sub by_release_then_priority {
$$a{fixed_version}{name} cmp $$b{fixed_version}{name}
|| $$b{priority}{id} <=> $$a{priority}{id};
}