Scroll to navigation

Net::GitHub::V3::Issues(3pm) User Contributed Perl Documentation Net::GitHub::V3::Issues(3pm)

NAME

Net::GitHub::V3::Issues - GitHub Issues API

SYNOPSIS

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

DESCRIPTION

METHODS

Issues

<http://developer.github.com/v3/issues/>

    my @issues = $issue->issues();
    my @issues = $issue->issues(filter => 'assigned', state => 'open');
    while (my $next_issue = $issues->next_issue(...)) { ...; }
    

Returns issues assigned to the authenticated user.

To ease the keyboard, we provied two ways to call any method which starts with :user/:repo

1. SET user/repo before call methods below

    $gh->set_default_user_repo('fayland', 'perl-net-github'); # take effects for all $gh->
    $issue->set_default_user_repo('fayland', 'perl-net-github'); # only take effect to $gh->issue
    my @issues = $repos->issues;

2. If it is just for once, we can pass :user, :repo before any arguments

    my @issues = $issue->repos_issues($user, $repo);
    my @issues = $issue->repos_issues;
    my @issues = $issue->repos_issues($user, $repos);
    my @issues = $issue->repos_issues( { state => 'open' } );
    my @issues = $issue->repos_issues($user, $repos, { state => 'open' } );
    while (my $r_issue = $issue->next_repos_issue(...)) { ...; }
    
    my $issue = $issue->issue($issue_number);
    
    my $isu = $issue->create_issue( {
        "title" => "Found a bug",
        "body" => "I'm having a problem with this.",
        "assignee" => "octocat",
        "milestone" => 1,
        "labels" => [
            "Label1",
            "Label2"
        ]
    } );
    
    my $isu = $issue->update_issue( $issue_number, {
        state => 'closed'
    } );
    

Issue Comments API

<http://developer.github.com/v3/issues/comments/>

    my @comments = $issue->comments($issue_number);
    while (my $comment = $issue->next_comment($issue_number)) { ...; }
    my $comment  = $issue->comment($comment_id);
    my $comment  = $issue->create_comment($issue_number, {
        "body" => "a new comment"
    });
    my $comment = $issue->update_comment($comment_id, {
        "body" => "Nice change"
    });
    my $st = $issue->delete_comment($comment_id);
    

Issue Event API

<http://developer.github.com/v3/issues/events/>

    my @events = $issue->events($issue_number);
    while (my $event = $issue->next_event($issue_number)) { ...; }
    my @events = $issue->repos_events;
    while (my $r_event = $issue->next_repos_event) { ...; }
    my $event  = $issue->event($event_id);
    

Issue Labels API

<http://developer.github.com/v3/issues/labels/>

    my @labels = $issue->labels;
    while (my $label = $issue->next_label) { ...; }
    my $label  = $issue->label($label_name);
    my $label  = $issue->create_label( {
        "name" => "API",
        "color" => "FFFFFF"
    } );
    my $label  = $issue->update_label( $label_name, {
        "name" => "bugs",
        "color" => "000000"
    } );
    my $st = $issue->delete_label($label_name);
    
    my @labels = $issue->issue_labels($issue_number);
    my @labels = $issue->create_issue_label($issue_number, ['New Label']);
    my $st = $issue->delete_issue_label($issue_number, $label_name);
    my @labels = $issue->replace_issue_label($issue_number, ['New Label']);
    my $st = $issue->delete_issue_labels($issue_number);
    my @lables = $issue->milestone_labels($milestone_id);
    while (my $label = $issue->next_milestone_label($milestone_id)) { ...; }
    

Issue Milestones API

<http://developer.github.com/v3/issues/milestones/>

    my @milestones = $issue->milestones;
    my @milestones = $issue->milestones( { state => 'open' } );
    while (my $milestone = $issue->next_milestone( ... )) { ...; }
    my $milestone  = $issue->milestone($milestone_id);
    my $milestone  = $issue->create_milestone( {
        "title" => "String",
        "state" => "open",
        "description" => "String",
    } );
    my $milestone  = $issue->update_milestone( $milestone_id, {
        title => 'New Title'
    } );
    my $st = $issue->delete_milestone($milestone_id);
    

AUTHOR & COPYRIGHT & LICENSE

Refer Net::GitHub

2022-10-08 perl v5.34.0