Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 493
klogd Avatar asked Oct 28 '14 07:10

klogd


2 Answers

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/

like image 140
klogd Avatar answered Sep 28 '22 06:09

klogd


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

like image 44
VonC Avatar answered Sep 28 '22 06:09

VonC