GithubHelp home page GithubHelp logo

mantisbt-plugins / apiextend Goto Github PK

View Code? Open in Web Editor NEW
3.0 6.0 1.0 68 KB

Extend the MantisBT REST API with issue count and version badges

Home Page: https://app1.spmeesseman.com/projects

License: GNU General Public License v3.0

PHP 100.00%
mantisbt-plugin

apiextend's Introduction

ApiExtend MantisBT Plugin

app-type app-lang app-publisher authors

MantisBT issues open MantisBT issues closed MantisBT version current MantisBT version next

Description

This plugin extends the MantisBT REST API. This plugin was developed and tested on MantisBT 2.21.1.

Installation

Extract the release archive to the MantisBT installations plugins folder:

cd /var/www/mantisbt/plugins
wget -O ApiExtend.zip https://github.com/mantisbt-plugins/ApiExtend/releases/download/v1.0.0/ApiExtend.zip
unzip ApiExtend.zip
rm -f ApiExtend.zip

Ensure to use the latest released version number in the download url: MantisBT version current (version badge available via the ApiExtend Plugin)

Install the plugin using the default installation procedure for a MantisBT plugin in Manage -> Plugins.

Web Server Configuration

For Apache configuration, see the example Location directive found in api/apache2-site-config

REST API

The extended REST API can be authenticated in one of two ways:

  1. Set the API user and API token in the Plugin settings for dedicated API acess using one static account.
  2. Set the Authorization header value to a user API token for specific user access.

In either case, the token can be created in User Preferences for the user that will be used to make the requests under.

In case 1, the authorization token can be sent as a GET or POST parameter as opposed to having to be sent in the header. This allows the svg badges to be linked to from within a README file.

For example:

Authorization: DvhKlx9_g5dNkBEI4jqVmwAxaN9a1y3P

The following endpoints are available to automatically create/update releases with assets/files:

GET: /plugins/ApiExtend/api/issues/{project}/{type}

Retrieved issues with a given set of filter key/value pairs.

Where project is the MantisBT project name

Where type is one of 'open', 'closed', or 'all'.

Example JSON Request

GET `https://my.domain.com/mantisbt/plugins/ApiExtend/api/issues/ProjectName/all`
content-type: application/json
{
    "filters": "[{\"property\": \"custom_field_3\",\"value\": \"u1\"},{\"property\": \"custom_field_4\",\"value\": \"u2\"}]"
}

The filters paramenter should be url encoded and provided in the URL as a GET parameter.

GET: /plugins/ApiExtend/api/issues/count/{project}/{type}

Retrieves an issues count for open or closed issues.

Where project is the MantisBT project name

Where type is one of 'open' or 'closed'.

Example JSON Response Body

{
    "count": 132
}

GET: /plugins/ApiExtend/api/issues/countbadge/{project}/{type}

Retrieves an issues count badge for open or closed issues, for use in readme files.

badge1

Where project is the MantisBT project name

Where type is one of 'open' or 'closed'.

GET: /plugins/ApiExtend/api/version/{project}/{type}

Retrieves the current and/or next version.

Where project is the MantisBT project name

Where type is one of 'open' or 'closed'.

Example JSON Response Body

{
    "version": 1.9.19
}

GET: /plugins/ApiExtend/api/versionbadge/{project}/{type}

Retrieves a versionbadge for the current and/or next version, for use in readme files.

badge2

Where project is the MantisBT project name

Where type is one of 'open' or 'closed'.

Supported GET parameters:

Parameter Name Description Type Default Value
color The badge color, do not prepend the hash '#' string 0E7FBF

Example request url:

https://app1.spmeesseman.com/projects/plugins/ApiExtend/api/versionbadge/Releases/current?color=D7A54A

Jenkins Integration

Integrates with the jenkins-mantisbt Plugin.

apiextend's People

Contributors

spmeesseman avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

grv87

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.