Github.searchIssues()

List GitHub issues matching the specified criteria.

Usage

Hover over inputs/exits for more info.

var Github = require('machinepack-github');


// List GitHub issues matching the specified criteria.

Github.searchIssues({

repo: 'sails',

owner: 'balderdashy',

: ,

state: 'open',

lastUpdatedBefore: 1442710858715,

withAllOfTheseLabels: [ 'question' ],

withNoneOfTheseLabels: [ 'bug' ],

includePullRequests: false,

includeOtherIssues: true,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (issues) {

 

},

});

Inputs

repo required

The name of the Github repo (i.e. as it appears in the URL on GitHub)

'sails'
owner required

The name of the organization or user that owns the repo (i.e. as it appears in the URL on GitHub)

'balderdashy'
undefined

state

The state to filter issues by (either "open" or "closed".

'open'
lastUpdatedBefore

A JS timestamp.

1442710858715
withAllOfTheseLabels

A set of issue labels.

[ 'question' ]
withNoneOfTheseLabels

A set of issue labels.

[ 'bug' ]
includePullRequests

Whether to include pull requests in search results.

false
includeOtherIssues

Whether to include normal issues (i.e. things that aren't pull requests) in search results.

true

Exits

error

An unexpected error occurred.

success

OK.

[ { id: 83393186,
    url: 'https://api.github.com/repos/balderdashy/sails/issues/2976',
    number: 2976,
    state: 'open',
    pull_request: '*',
    title: 'Error 500 on duplicate key found in database',
    body: 'How to catch the `error` occured while db find a duplicate key...',
    locked: false,
    assignee: '*',
    milestone: '*',
    comments: 2,
    created_at: '2015-06-01T08:52:02Z',
    updated_at: '2015-06-02T09:15:20Z',
    user: 
     { id: 5616249,
       login: 'nikhiljohn10',
       avatar_url: 'https://avatars.githubusercontent.com/u/5616249?v=3',
       html_url: 'https://github.com/nikhiljohn10' },
    labels: 
     [ { url: 'https://api.github.com/repos/balderdashy/sails/labels/featurerequest',
         name: 'featurerequest',
         color: '16ACC2' } ] } ]