npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

agilemanager-api

v1.1.4

Published

HPE's Agile Manager client API module for NodeJS

Downloads

22

Readme

view on npm view on npm npm module downloads Dependency Status Build Coverage Status bitHound Overall Score bitHound Code Security Responsible Disclosure

semantic-release Greenkeeper badge

agilemanager-api

HPE's Agile Manager client API module for NodeJS

Example Use Case: Dashboard

Easily integrate with Agile Manager to create your very own dashboard UI:

image

Install

npm install agilemanager-api

Setup

Prepare an options object with clientId and clientSecret keys from Agile Manager's configuration area:

var options = {
	clientId: 'api_client_0000000_0',
	clientSecret: 'lknNSDASY6458ub'
};

Require the agilemanager-api npm module after it was installed and instantiate the object with the prepared options:

var AGM = require('agilemanager-api');
var agm = new AGM(options);

login Example

Perform an AGM login method to authenticate the API and continue working with the rest of the methods available

agm.login(function (err, body) {

  /** body is an object with the token information
   *
   * { 
   *   access_token: '197247213_2639ed2e-6c73-4abg-7991-9872dbccf1',
   *   token_type: 'bearer',
   *   expires_in: 3599,
   *   scope: 'read trust write'
   * }
   */ 
  
  // Do something with token...
});

query Example

Perform an AGM agm.query(fn) method on any type of resource.

The agm.query(fn) method expects an object with the following members:

  • workspaceId - the workspace id in AGM
  • resource - the resource type, can be any one of the listed resources
  • query - the actual query to perform, accepting statements with ; char as a logical AND and || as logical OR
  • fields - a list of specific fields to be filtered in the returned response
  • orderBy - a field to order the results, by default results are of ascending order or with a prefix - symbol for decesending results (for example: fields: -name)
  • limit and offset - both of these options allow to specify numbers for the purpose of paginated results

For example, to query for a list of backlog items, with id bigger than 2000, and getting back only the name field in the JSON response:


// Prepare the query options object
var queryOptions = {
	workspaceId: '1000',
	resource: 'backlog_items',
	query: 'id>2000',
	fields: 'id,name',
	orderBy: 'name',
	limit: 10,
	offset: 0
};

// Call the query method using the 
agm.query(queryOptions, function(err, body) {
  /**
   * body contains a JSON object response with data member and TotalResults member:
   * {
   *  data: 
   *   [{
   *     type: 'backlog_item',
   *     subtype: 'defect',
   *     id: 2012,
   *     name: 'URL uploaded images are not cropped
   correctly'
   *   }],
   *  TotalResults: 1
   * }
   *
   *
   *
   */

  // Do something with body JSON object resopnse
});

resources Example

Using the agm.resources(fn) method it's possible to perform CRUD operations directly on any type of supported resources.

Example of creating a user story:

/**
 * Perform a query on a workspace and resource
 * Create a user story
 *
 * @param {object} resourceOptions - expect an object with the following:
 *   - workspaceId - the workspace id
 *   - resource - the type of resource to perform the action on (@see list of [resources](https://github.com/lirantal/agilemanager-api#resources)
 *   - method - one of: GET, POST, PUT, DELETE
 *   - data - an array of objects with the backlog item supported fields, allowing to create more than one backlog item with fie
 */

var resourceOptions = {
	workspaceId: '1000',
	resource: 'backlog_items',
	method: 'POST',
	data: [{
		name: 'New user story',
		subtype: 'user_story'
	}]
};

agm.resource(resourceOptions, function(err, body) {

	// Returned JSON response object in body looks as follows:
	//
	// { data: 
	//    [ { type: 'backlog_item',
	//        subtype: 'user_story',
	//        story_priority: null,
	//        num_of_tasks: null,
	//        cover_status: 'Not Covered',
	//        release_id: null,
	//        id: 1945,
	//        kanban_status_id: null,
	//        author: 'api_client_49871541_16',
	//        rank: 3610000,
	//        remaining: null,
	//        estimated: null,
	//        description: null,
	//        name: 'New user story',
	//        dev_comments: null,
	//        kan_status_duration: 0,
	//        blocked: null,
	//        application_id: null,
	//        kanban_parent_status_id: null,
	//        status: 'New',
	//        story_points: null,
	//        sprint_id: null,
	//        creation_date: '2015-11-09',
	//        kan_parent_duration: 0,
	//        last_modified: '2015-11-09T18:44:20Z',
	//        theme_id: null,
	//        team_id: null,
	//        invested: null,
	//        assigned_to: null,
	//        actual: null,
	//        archive_status: 0,
	//        feature_id: null } ],
	//   TotalResults: 1 }

        // Do more things with the body response object...
});

Example of deleting a user story

Example of creating a user story:

/**
 * Perform a query on a workspace and resource
 * Create a user story
 *
 * @param {object} resourceOptions - expect an object with the following:
 *   - workspaceId - the workspace id
 *   - resource - the type of resource to perform the action on (@see list of [resources](https://github.com/lirantal/agilemanager-api#resources)
 *   - method - one of: GET, POST, PUT, DELETE
 *   - data - an array of objects with the backlog item supported fields, allowing to create more than one backlog item with fie
 */

var resourceOptions = {
	workspaceId: '1000',
	resource: 'backlog_items',
	method: 'DELETE',
	entityId: '1945'
};

agm.resource(resourceOptions, function(err, body) {
        // Do more things with the body response object...
});

Agile Manager API Usage

RESTful API

Agile Manager's API is RESTful and supports

  • GET fetch a new item
  • POST creates a new item
  • PUT updates an item
  • DELETE removes an item

As can be illustrated in the following screenshot image

(image credit to HPE's Agile Manager API Intractive Help (beta)

Resources

The API supports the following resources, which can be used as part of the query method:

  • applications
  • backlog_items
  • backlog_item (attachments)
  • features
  • feature (attachments)
  • release_teams
  • releases
  • release (attachments)
  • sprints
  • tasks
  • team_members
  • teams
  • themes
  • theme (attachments)
  • workspaces

Author

Liran Tal [email protected]