1Net::GitHub::V3::IssuesU(s3e)r Contributed Perl DocumentaNteito:n:GitHub::V3::Issues(3)
2
3
4

NAME

6       Net::GitHub::V3::Issues - GitHub Issues API
7

SYNOPSIS

9           use Net::GitHub::V3;
10
11           my $gh = Net::GitHub::V3->new; # read L<Net::GitHub::V3> to set right authentication info
12           my $issue = $gh->issue;
13

DESCRIPTION

15   METHODS
16       Issues
17
18       <http://developer.github.com/v3/issues/>
19
20       issues
21               my @issues = $issue->issues();
22               my @issues = $issue->issues(filter => 'assigned', state => 'open');
23               while (my $next_issue = $issues->next_issue(...)) { ...; }
24
25           Returns issues assigned to the authenticated user.
26
27       To ease the keyboard, we provied two ways to call any method which
28       starts with :user/:repo
29
30       1. SET user/repo before call methods below
31
32           $gh->set_default_user_repo('fayland', 'perl-net-github'); # take effects for all $gh->
33           $issue->set_default_user_repo('fayland', 'perl-net-github'); # only take effect to $gh->issue
34           my @issues = $repos->issues;
35
36       2. If it is just for once, we can pass :user, :repo before any
37       arguments
38
39           my @issues = $issue->repos_issues($user, $repo);
40
41       repos_issues
42               my @issues = $issue->repos_issues;
43               my @issues = $issue->repos_issues($user, $repos);
44               my @issues = $issue->repos_issues( { state => 'open' } );
45               my @issues = $issue->repos_issues($user, $repos, { state => 'open' } );
46               while (my $r_issue = $issue->next_repos_issue(...)) { ...; }
47
48       issue
49               my $issue = $issue->issue($issue_number);
50
51       create_issue
52               my $isu = $issue->create_issue( {
53                   "title" => "Found a bug",
54                   "body" => "I'm having a problem with this.",
55                   "assignee" => "octocat",
56                   "milestone" => 1,
57                   "labels" => [
58                       "Label1",
59                       "Label2"
60                   ]
61               } );
62
63       update_issue
64               my $isu = $issue->update_issue( $issue_number, {
65                   state => 'closed'
66               } );
67
68       Issue Comments API
69
70       <http://developer.github.com/v3/issues/comments/>
71
72       comments
73       comment
74       create_comment
75       update_comment
76       delete_comment
77               my @comments = $issue->comments($issue_number);
78               while (my $comment = $issue->next_comment($issue_number)) { ...; }
79               my $comment  = $issue->comment($comment_id);
80               my $comment  = $issue->create_comment($issue_number, {
81                   "body" => "a new comment"
82               });
83               my $comment = $issue->update_comment($comment_id, {
84                   "body" => "Nice change"
85               });
86               my $st = $issue->delete_comment($comment_id);
87
88       Issue Event API
89
90       <http://developer.github.com/v3/issues/events/>
91
92       events
93       repos_events
94               my @events = $issue->events($issue_number);
95               while (my $event = $issue->next_event($issue_number)) { ...; }
96               my @events = $issue->repos_events;
97               while (my $r_event = $issue->next_repos_event) { ...; }
98               my $event  = $issue->event($event_id);
99
100       Issue Labels API
101
102       <http://developer.github.com/v3/issues/labels/>
103
104       labels
105       label
106       create_label
107       update_label
108       delete_label
109               my @labels = $issue->labels;
110               while (my $label = $issue->next_label) { ...; }
111               my $label  = $issue->label($label_name);
112               my $label  = $issue->create_label( {
113                   "name" => "API",
114                   "color" => "FFFFFF"
115               } );
116               my $label  = $issue->update_label( $label_name, {
117                   "name" => "bugs",
118                   "color" => "000000"
119               } );
120               my $st = $issue->delete_label($label_name);
121
122       issue_labels
123       create_issue_label
124       delete_issue_label
125       replace_issue_label
126       delete_issue_labels
127       milestone_labels
128               my @labels = $issue->issue_labels($issue_number);
129               my @labels = $issue->create_issue_label($issue_number, ['New Label']);
130               my $st = $issue->delete_issue_label($issue_number, $label_name);
131               my @labels = $issue->replace_issue_label($issue_number, ['New Label']);
132               my $st = $issue->delete_issue_labels($issue_number);
133               my @lables = $issue->milestone_labels($milestone_id);
134               while (my $label = $issue->next_milestone_label($milestone_id)) { ...; }
135
136       Issue Milestones API
137
138       <http://developer.github.com/v3/issues/milestones/>
139
140       milestones
141       milestone
142       create_milestone
143       update_milestone
144       delete_milestone
145               my @milestones = $issue->milestones;
146               my @milestones = $issue->milestones( { state => 'open' } );
147               while (my $milestone = $issue->next_milestone( ... )) { ...; }
148               my $milestone  = $issue->milestone($milestone_id);
149               my $milestone  = $issue->create_milestone( {
150                   "title" => "String",
151                   "state" => "open",
152                   "description" => "String",
153               } );
154               my $milestone  = $issue->update_milestone( $milestone_id, {
155                   title => 'New Title'
156               } );
157               my $st = $issue->delete_milestone($milestone_id);
158
160       Refer Net::GitHub
161
162
163
164perl v5.38.0                      2023-07-21        Net::GitHub::V3::Issues(3)
Impressum