Jezda.Common.Integrations.Jira
2.0.0
See the version list below for details.
dotnet add package Jezda.Common.Integrations.Jira --version 2.0.0
NuGet\Install-Package Jezda.Common.Integrations.Jira -Version 2.0.0
<PackageReference Include="Jezda.Common.Integrations.Jira" Version="2.0.0" />
<PackageVersion Include="Jezda.Common.Integrations.Jira" Version="2.0.0" />
<PackageReference Include="Jezda.Common.Integrations.Jira" />
paket add Jezda.Common.Integrations.Jira --version 2.0.0
#r "nuget: Jezda.Common.Integrations.Jira, 2.0.0"
#:package Jezda.Common.Integrations.Jira@2.0.0
#addin nuget:?package=Jezda.Common.Integrations.Jira&version=2.0.0
#tool nuget:?package=Jezda.Common.Integrations.Jira&version=2.0.0
Jezda.Common.Integrations.Jira
A strongly-typed .NET client for Jira Cloud REST API (v3), built on top of Jezda.Common.Integrations.
✨ Features
- Projects: List all visible projects.
- Search: Search issues using JQL (Jira Query Language).
- Authentication: Supports Basic Auth (Email + API Token) for Jira Cloud.
- Dependency Injection: Ready-to-use
IServiceCollectionextension.
📦 Installation
Add the project reference or NuGet package:
dotnet add package Jezda.Common.Integrations.Jira
⚙️ Configuration
Add the following section to your appsettings.json:
{
"Integrations": {
"Jira": {
"BaseUrl": "https://your-domain.atlassian.net/",
"Email": "your-email@example.com",
"ApiToken": "your-atlassian-api-token"
}
}
}
Note: For Jira Cloud, you must use an API Token, not your password. Generate one at id.atlassian.com.
🚀 Usage
1. Register Services
In your Program.cs:
using Jezda.Common.Integrations.Jira.Extensions;
builder.Services.AddJiraIntegration(builder.Configuration);
2. Inject and Use
Inject IJiraClient into your service:
public class JiraService
{
private readonly IJiraClient _jiraClient;
public JiraService(IJiraClient jiraClient)
{
_jiraClient = jiraClient;
}
public async Task PrintHighPriorityBugsAsync()
{
// Search using JQL
var jql = "project = 'MYPROJ' AND issuetype = Bug AND priority = High";
var result = await _jiraClient.SearchIssuesAsync(jql);
if (result != null)
{
foreach(var issue in result.Issues)
{
Console.WriteLine($"[{issue.Key}] {issue.Fields?.Summary} - {issue.Fields?.Status?.Name}");
}
}
}
}
Connection validation
ValidateConnectionAsync returns a rejection, InvalidToken, only when Jira rejects the token: 401. With
X-Seraph-LoginReason: AUTHENTICATION_DENIED it throws instead, because the CAPTCHA was triggered and the
token was not checked; the user has to sign in through the Jira website. Every other failure propagates,
including a 403, which can come from an IP allow list or a gateway, so an outage is not shown to the user as
a bad token.
The email and API token are sent as UTF-8, so an email with a character outside ASCII reaches Jira intact.
Two answers say nothing about the token, so every call on IJiraClient and the IExternalTaskProvider for Jira
throws HttpRequestException with the response's own status for them:
| What happened | StatusCode |
|---|---|
| Base URL redirects (3xx: the site was renamed, or single sign-on stands in front of Jira). The message names the target's host and path. | The 3xx |
| Success without a JSON content type (a login page, a website, a proxy) | The success status, e.g. 200 |
AddJiraIntegration turns off redirects on the default primary handler, because .NET drops Authorization on
the next hop and a valid token would read as rejected. Setups it cannot reach:
- A custom primary handler registered before
AddJiraIntegration: one that is notSocketsHttpHandlerorHttpClientHandlerstays as it is, and a warning is logged. Make sure it does not follow redirects. ConfigurePrimaryHttpMessageHandlercalled afterAddJiraIntegration, aJiraClientgiven anHttpClientmade outside DI, orJiraTaskProviderbuilt on your ownIHttpClientFactory: nothing warns, so setAllowAutoRedirect = falseon the handler yourself.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Jezda.Common.Integrations (>= 2.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.