klogd
klogd

Reputation: 1179

possible to embed Github list of issues (with specific tag) on website?

Does anyone know of an easy way to embed the list of issues with a specific tag from github onto a website?

This is to embed a list of open bugs on a project website.

Upvotes: 10

Views: 2434

Answers (2)

klogd
klogd

Reputation: 1179

Solution using jQuery:

There is a way to this easily using the github api using just javascript (no need to set up github account, registering api tokens, etc..)

Below is a small demo using jquery to get a list of all the open bugs for a github project (jquery in this example)

var urlToGetAllOpenBugs = "https://api.github.com/repos/jquery/jquery/issues?state=open&labels=bug";

$(document).ready(function () {
$.getJSON(urlToGetAllOpenBugs, function (allIssues) {
    $("div").append("found " + allIssues.length + " issues</br>");
    $.each(allIssues, function (i, issue) {
        $("div")
            .append("<b>" + issue.number + " - " + issue.title + "</b></br>")
            .append(issue.body + "</br></br></br>");
    });
});
});

jsfiddle: http://jsfiddle.net/bso6xLee/2/

Upvotes: 11

VonC
VonC

Reputation: 1323953

You would need to make a query (as in "Embedding Github's bug tracker within a website for the users to report directly from within the website").
Then you would generate the html section of your website page which would display the result of that query.

That would use the GitHub API on Issues

GET /user/issues

Use your account, or an account which sees only the repo(s) you want to list the issues from.

And you can specify the labels

labels string: A list of comma separated label names. Example: bug,ui,@high

Upvotes: 1

Related Questions