0.2.2 • Published 3 years ago

node-redmine v0.2.2

Weekly downloads
152
License
GPL-3.0
Repository
github
Last release
3 years ago

node-redmine

Build Status npm version

node-redmine is a nodejs library that supports 100% the Redmine's REST API's features.

Installation

To install node-redmine, simply:

npm install node-redmine

Usage

var Redmine = require('node-redmine');

// protocol required in Hostname, supports both HTTP and HTTPS
var hostname = process.env.REDMINE_HOST || 'http://redmine.zanran.me';
var config = {
  apiKey: process.env.REDMINE_APIKEY || 'bed1ba0544b681e530c2447341607f423c9c8781'
};

var redmine = new Redmine(hostname, config);

/**
 * Dump issue
 */
var dump_issue = function(issue) {
  console.log('Dumping issue:');
  for (var item in issue) {
    console.log('  ' + item + ': ' + JSON.stringify(issue[item]));
  }
};

redmine.issues({limit: 2}, function(err, data) {
  if (err) throw err;

  for (var i in data.issues) {
    dump_issue(data.issues[i]);
  }

  console.log('total_count: ' + data.total_count);
});

Supported features for Redmine REST API

ResourceStatusAvailabilitySupported
IssuesStable1.0
ProjectsStable1.0
Project MembershipsAlpha1.4
UsersStable1.1
Time EntriesStable1.1
NewsPrototype1.1
Issue RelationsAlpha1.3
VersionsAlpha1.3
Wiki PagesAlpha2.2
QueriesAlpha1.3
AttachmentsBeta1.3
Issue StatusesAlpha1.3
TrackersAlpha1.3
EnumerationsAlpha2.2
Issue CategoriesAlpha1.3
RolesAlpha1.4
GroupsAlpha2.1
Custom FieldsAlpha2.4
SearchAlpha3.3N/A

Links

Notice

  • node-redmine only supports using the JSON format.