Now that #112805: JSON menu callback for project issues is done and deployed, the next step would be to make it possible to get listings of issues via JSON. The most obvious way to do this would be to add a json display to the default issue queue views, akin to the RSS feed displays.

This would mostly render things like https://drupal.org/sandbox/goba/1470484 obsolete (or at least much easier to implement) and in general, would be a great thing for exporting our data to external clients.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dww’s picture

Title: Provide JSON output from issue views » Provide JSON output from issue queue listing views
sun’s picture

Seriously, I can't believe that something like this doesn't exist already...? (is that even possible?)

Nah. ;)

Google yields for "drupal views json":

1) http://drupal.org/project/views_json (obsolete) » http://drupal.org/project/views_datasource which looks nice on the surface (didn't check its code)

2) http://www.jefflinwood.com/2010/08/using-drupals-views-as-a-json-web-ser... mentions a built-in facility in Services module that allows to spit out any view as JSON.

3) http://joshhuckabee.com/getting-started-exhibit-using-drupal-and-views-p... (disclaimer: the author) mentions http://drupal.org/project/exhibit

Don't believe we need to re-invent something for this. Unlike a dedicated project issue node, I wouldn't expect anything special in the returned JSON lists.

Anonymous’s picture

To clarify, are we talking about actually using Views or not to generate the JSON lists of issue queues?

dww’s picture

I'm talking about configuring whatever needs to be configured so that all of the issue listing views let you append /json to the path (or whatever) to get the results rendered in JSON format. I'm not talking about any custom code here, per se, just configuration (ideally).

sun’s picture

@wildkatana: The goal is to use and leverage the existing Views-based views, since they already define fields, filters, arguments, and also access.

xjm’s picture

Issue tags: +drupal.org JSON

Tagging because I always lose issues that aren't filed against core.

xjm’s picture

heylookalive’s picture

Version: 6.x-1.x-dev » 7.x-2.x-dev
Issue summary: View changes
Status: Active » Needs review
FileSize
11.12 KB

Here's a basic patch making use of views_datasource to let us output a JSON listing. When setting up, Views messed with some of the relationships which altered the view probably due to an amount of stuff like Search API not being present on my local (did an install of this module with all dependencies). The patch simply adds new dependencies and a view display.

The new display has some extra fields like author and author uid, one key change is to created & updated which I've set to use UTC, and the ISO 8601 format as per http://stackoverflow.com/questions/10286204/the-right-json-date-format.

This will probably need a few looks but am keen to get a more useful feed out of the issue queue.

Status: Needs review » Needs work

The last submitted patch, 8: provide_json_project_issue_feed-1618262-8.patch, failed testing.

heylookalive’s picture

Status: Needs work » Needs review
FileSize
11.77 KB

No idea why testbot is upset, wouldn't have thought adding a new display would mess with things. Did notice that I didn't add new dependencies to the test.

Status: Needs review » Needs work

The last submitted patch, 10: provide_json_project_issue_feed-1618262-9.patch, failed testing.

heylookalive’s picture

Anyone out there?

drumm’s picture

For Drupal.org, RestWS now provides a query endpoint, such as https://www.drupal.org/api-d7/node.json?type=project_issue&field_project.... https://www.drupal.org/about-drupalorg/api has some more documentation. I'm not sure if that makes this issue redundant or not, since it doesn't have an easy translation from viewing the HTML table to the JSON output.

Can anyone else test this, since the testbot doesn't handle new dependencies well?