dapplo / Dapplo.Jira

This is a simple REST based JIRA client, written for Greenshot, by using Dapplo.HttpExtension
MIT License
35 stars 14 forks source link
hacktoberfest

Dapplo.Jira

This is a simple REST based JIRA client, written for Greenshot, by using Dapplo.HttpExtension

If you like this project, maybe it saves you time or money, and want to support me to continue the development? You can donate something via GitHub Sponsors or Paypal: https://www.paypal.me/dapplo

This client has support for:

For examples on how to use this library, I advice you to look at the test cases.

A example to find issues which are assigned to someone who is currently (or langer) not available, and remove the assignment

// Preferably use a "bot" user for maintenance
var username = Environment.GetEnvironmentVariable("jira_test_username");
var password = Environment.GetEnvironmentVariable("jira_test_password");
var client = JiraClient
    .Create(TestJiraUri)
    .SetBasicAuthentication(username, password);

const string unavailableUser = "Robin Krom";
// Find all issues in a certain state and assigned to a user who is not available
var searchResult = await client.Issue.SearchAsync(Where.And(Where.Assignee.Is(unavailableUser), Where.Status.Is("Building")));

foreach (var issue in searchResult.Issues)
{
    // Remote the assignment, to make clear no-one is working on it
    await issue.AssignAsync(User.Nobody);
    // Comment the reason to the issue
    await issue.AddCommentAsync($"{unavailableUser} is currently not available.");
}

snippet source | anchor