Giter Club home page Giter Club logo

pathoschild.fluentjira's Introduction

Pathoschild.FluentJira

A strongly-typed, fluent HTTP client for JIRA's REST API using the .NET 4.5 HttpClient.

This is an early development version.

Usage

This client is an extension of Pathoschild.FluentHttpClient, so you can execute any HTTP request against the API and get a strongly-typed response. The structures returned by the client look like the actual API responses, so the JIRA API documentation is entirely relevant.

Example

// create client
IClient client = new Client("https://example.atlassian.net/rest/api/latest/"); // there's an optional overload for username & password

// retrieve an issue
 Issue issue = client
    .Get("issue/EXAMPLE-14")
    .RetrieveAs<Issue>();

// use the data
string summary = issue.Fields.Summary; // "This is an example issue title"
string estimate = issue.Fields.TimeTracking.RemainingEstimate; // "2d 4h"
int estimateSeconds = issue.Fields.TimeTracking.RemainingEstimate; // 187200

// really use the data
string emailOfFirstCommenter = issue.Fields.Comments.Comments.First().Author.EmailAddress;

Self links

The client also recognizes the Self URLs that link to further information on an object. For example, this code gets all the information for the user who posted the above issue:

// this is the issue we have above
Issue issue = ...;

// it already basic user information
User basicUser = issue.Fields.Assignee;
string username = basicUser.Name;
string email = basicUser.EmailAddress;

// but you can also retrieve the full description
User user = client
    .Get(basicUser.Self)
    .RetrieveAs<User>();

string timeZone = user.TimeZone; // "America/Montreal"
IEnumerable<string> groups = user.Groups.Items.Select(p => p.Name); // ["administrators", "developers", "users"]

For further information, see the Pathoschild.FluentHttpClient documentation.

pathoschild.fluentjira's People

Contributors

pathoschild avatar

Watchers

James Cloos avatar  avatar

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.