Bitzsoft.Integrations.ProjectManagement.JiraCloud 1.0.4

dotnet add package Bitzsoft.Integrations.ProjectManagement.JiraCloud --version 1.0.4
                    
NuGet\Install-Package Bitzsoft.Integrations.ProjectManagement.JiraCloud -Version 1.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bitzsoft.Integrations.ProjectManagement.JiraCloud" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bitzsoft.Integrations.ProjectManagement.JiraCloud" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Bitzsoft.Integrations.ProjectManagement.JiraCloud" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bitzsoft.Integrations.ProjectManagement.JiraCloud --version 1.0.4
                    
#r "nuget: Bitzsoft.Integrations.ProjectManagement.JiraCloud, 1.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Bitzsoft.Integrations.ProjectManagement.JiraCloud@1.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bitzsoft.Integrations.ProjectManagement.JiraCloud&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Bitzsoft.Integrations.ProjectManagement.JiraCloud&version=1.0.4
                    
Install as a Cake Tool

Bitzsoft.Integrations.ProjectManagement.JiraCloud

Atlassian Jira Cloud 项目管理适配器。将 IProjectManagementService 统一抽象接口全面适配到底层 Bitzsoft.Integrations.JiraCloud 单体连接器的 IJiraCloudClient,支持任务(Issue)创建、详情获取、信息更新、工作流状态流转与受控 JQL 检索。

功能特性

  • 完整任务生命周期管理:全面支持 Issue 创建(CreateTaskAsync)、详情获取(GetTaskAsync)、字段更新(UpdateTaskAsync)与任务完成(CompleteTaskAsync)。
  • 智能工作流状态跃迁(Transitions):内置智能状态映射算法,自动发现目标状态(如 Done/Closed/Resolved、In Progress/Start Progress、To Do/Reopen 等),调用 Jira Cloud REST API 执行状态机跃迁(TransitionTaskAsync)。
  • Issue 讨论评论追加:支持为指定 Issue 写入讨论评论(AddCommentAsync)。
  • 受控 JQL 检索:基于 Project 与 Status 进行受控 JQL 检索(ListTasksAsync),内置内存级别指派人过滤。
  • 多租户与动态上下文工厂:通过 IJiraCloudPmContextFactory 动态为每一次 API 调用装配 JiraCloudRequestContext(包含租户标识 TenantId、授权主体 AuthorizationSubject 及凭据 ProfileId),原生支持 SaaS 多租户隔离。
  • 边界说明:Jira Cloud 项目创建(CreateProjectAsync)与项目列表查询(ListProjectsAsync)属于 Jira Admin 专属管理范畴,调用将抛出明确的 ProjectManagementException,请通过 Jira 管理界面或专用 Admin API 维护项目空间。

安装

dotnet add package Bitzsoft.Integrations.ProjectManagement.JiraCloud
<PackageReference Include="Bitzsoft.Integrations.ProjectManagement.JiraCloud" Version="1.0.0" />

配置

在 appsettings.json 中配置 Jira Cloud 适配器调用上下文参数:

{
  "ProjectManagement": {
    "JiraCloud": {
      "TenantId": "tenant-default",
      "AuthorizationSubject": "system-operator",
      "ProfileId": "default"
    }
  }
}

配置项说明

配置键 类型 默认值 说明
TenantId string "default" Jira Cloud 租户标识。
AuthorizationSubject string "system" 授权主体或操作者标识(如当前用户或系统服务账号)。
ProfileId string? null 凭据配置方案标识(对应底层 JiraCloud 单体的 EndpointProfile)。

注册服务

宿主应用须先通过 JiraCloud 单体注册底层 IJiraCloudClient,再注册本项目管理适配器:

using Bitzsoft.Integrations.JiraCloud;
using Microsoft.Extensions.DependencyInjection;

// 1. 注册底层 Jira Cloud 单体客户端
// services.AddBitzsoftJiraCloud(endpointProfile, issuePolicies, webhookPolicies, webhookReceivers);

// 2. 注册项目管理适配器(三种方式任选其一):

// 方式 A:通过 IConfiguration 配置节注册(单租户或缺省配置推荐)
services.AddJiraCloudProjectManagement(configuration);

// 自定义配置节路径:
// services.AddJiraCloudProjectManagement(configuration, "Integrations:JiraCloud");

// 方式 B:使用固定上下文注册
var context = new JiraCloudRequestContext(
    tenantId: "tenant-1",
    authorizationSubject: "operator-user",
    profileId: "default");
services.AddJiraCloudProjectManagement(context);

// 方式 C:使用自定义上下文工厂(多租户 SaaS 架构强烈推荐)
services.AddJiraCloudProjectManagement<CustomTenantJiraCloudContextFactory>();

多租户工厂实现示例

using Bitzsoft.Integrations.JiraCloud;
using Bitzsoft.Integrations.ProjectManagement.JiraCloud;

public class CustomTenantJiraCloudContextFactory : IJiraCloudPmContextFactory
{
    private readonly ITenantProvider _tenantProvider;

    public CustomTenantJiraCloudContextFactory(ITenantProvider tenantProvider)
    {
        _tenantProvider = tenantProvider;
    }

    public JiraCloudRequestContext Create()
    {
        var currentTenantId = _tenantProvider.GetCurrentTenantId();
        var currentUser = _tenantProvider.GetCurrentUserId();
        return new JiraCloudRequestContext(
            tenantId: currentTenantId,
            authorizationSubject: currentUser,
            profileId: "default");
    }
}

使用示例(通用 IProjectManagementService)

以下代码演示如何在业务类中通过依赖注入使用通用的 IProjectManagementService 契约操作 Jira Cloud Issues:

using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Bitzsoft.Integrations.ProjectManagement;
using Bitzsoft.Integrations.ProjectManagement.Dtos;
using TaskStatus = Bitzsoft.Integrations.ProjectManagement.Dtos.TaskStatus;

namespace YourNamespace;

public class JiraCloudIssueAppService
{
    private readonly IProjectManagementService _pmService;

    public JiraCloudIssueAppService(IProjectManagementService pmService)
    {
        _pmService = pmService;
    }

    public async Task<PmTask> CreateIssueAsync(
        string projectKey,
        string summary,
        string description,
        string? assigneeAccountId = null,
        DateTimeOffset? dueDate = null,
        CancellationToken cancellationToken = default)
    {
        var request = new CreateTaskRequest
        {
            ProjectId = projectKey,
            Name = summary,
            Description = description,
            AssigneeId = assigneeAccountId,
            DueDate = dueDate,
            Priority = TaskPriority.Medium
        };

        return await _pmService.CreateTaskAsync(request, cancellationToken);
    }

    public async Task<PmTask> GetIssueAsync(
        string issueKey,
        CancellationToken cancellationToken = default)
    {
        return await _pmService.GetTaskAsync(issueKey, cancellationToken);
    }

    public async Task<PmResult> UpdateIssueAsync(
        string issueKey,
        string summary,
        string description,
        CancellationToken cancellationToken = default)
    {
        var request = new UpdateTaskRequest
        {
            TaskId = issueKey,
            Name = summary,
            Description = description
        };

        return await _pmService.UpdateTaskAsync(request, cancellationToken);
    }

    public async Task<PmResult> CompleteIssueAsync(
        string issueKey,
        CancellationToken cancellationToken = default)
    {
        // 内部自动执行 Transitions 跃迁至 Done 状态
        return await _pmService.CompleteTaskAsync(issueKey, cancellationToken);
    }

    public async Task<List<PmTask>> ListProjectIssuesAsync(
        string projectKey,
        CancellationToken cancellationToken = default)
    {
        var request = new ListTasksRequest
        {
            ProjectId = projectKey,
            Status = TaskStatus.InProgress,
            PageIndex = 1,
            PageSize = 50
        };

        return await _pmService.ListTasksAsync(request, cancellationToken);
    }
}

专有扩展能力(JiraCloudPmAdapter 增强操作)

JiraCloudPmAdapter 还提供了直接的工作流智能状态流转(TransitionTaskAsync)以及 Issue 评论追加(AddCommentAsync)能力:

using System;
using System.Threading;
using System.Threading.Tasks;
using Bitzsoft.Integrations.ProjectManagement;
using Bitzsoft.Integrations.ProjectManagement.Dtos;
using Bitzsoft.Integrations.ProjectManagement.JiraCloud;

namespace YourNamespace;

public class JiraCloudAdvancedWorkflowService
{
    private readonly JiraCloudPmAdapter _adapter;

    public JiraCloudAdvancedWorkflowService(IProjectManagementService pmService)
    {
        if (pmService is JiraCloudPmAdapter adapter)
        {
            _adapter = adapter;
        }
        else
        {
            throw new InvalidOperationException("当前注册的 Provider 不是 JiraCloudPmAdapter");
        }
    }

    public async Task<bool> MoveIssueStateAsync(
        string issueKey,
        string targetStatus,
        string? note = null,
        CancellationToken cancellationToken = default)
    {
        // 智能匹配 In Progress / In Development / Done 等状态动作并执行流转
        var transitionResult = await _adapter.TransitionTaskAsync(issueKey, targetStatus, cancellationToken);
        if (!transitionResult.Success)
        {
            return false;
        }

        if (!string.IsNullOrWhiteSpace(note))
        {
            await _adapter.AddCommentAsync(issueKey, note, cancellationToken);
        }

        return true;
    }
}

依赖

包 说明
Bitzsoft.Integrations.ProjectManagement 项目管理服务统一抽象层
Bitzsoft.Integrations.JiraCloud Jira Cloud 底层单体连接器(提供 IJiraCloudClient)
Bitzsoft.Integrations.Core 公共基座与供应商解析机制
Bitzsoft.Integrations.Compatibility 多目标框架兼容性工具集
Bitzsoft.Integrations.RequestLogging 出站请求审计与耗时追踪日志

相关包

供应商 / 组件 包名 说明
统一抽象 Bitzsoft.Integrations.ProjectManagement 统一接口定义、基础模型与结果包装
Asana Bitzsoft.Integrations.ProjectManagement.Asana Asana 任务与项目协作连接器
Azure DevOps Bitzsoft.Integrations.ProjectManagement.AzureDevOps 微软 Azure DevOps Boards 敏捷工单与 WIQL 检索
GitHub Bitzsoft.Integrations.ProjectManagement.GitHub GitHub Issues / PR / 里程碑与协同
GitLab Bitzsoft.Integrations.ProjectManagement.GitLab GitLab Issues / Notes / MR 敏捷协同
Gitee Bitzsoft.Integrations.ProjectManagement.Gitee 码云 Gitee Issues / 状态流转与工单协同
Jira Cloud Bitzsoft.Integrations.ProjectManagement.JiraCloud Atlassian Jira Cloud 任务生命周期与工作流流转
Jira Data Center Bitzsoft.Integrations.ProjectManagement.JiraDataCenter Jira Server / Data Center 私有部署与 JQL/Transitions
Monday Bitzsoft.Integrations.ProjectManagement.Monday monday.com 工作流与任务管理
ONES Bitzsoft.Integrations.ProjectManagement.Ones ONES 企业级敏捷研发管理
PingCode Bitzsoft.Integrations.ProjectManagement.PingCode PingCode 研发项目与工单协作
TAPD Bitzsoft.Integrations.ProjectManagement.Tapd 腾讯敏捷协作平台(需求/缺陷/任务三态工作流)
Teambition Bitzsoft.Integrations.ProjectManagement.Teambition 阿里巴巴 Teambition 协同连接器
Trello Bitzsoft.Integrations.ProjectManagement.Trello Trello 看板与卡片协同
阿里云效 Bitzsoft.Integrations.ProjectManagement.Yunxiao 阿里云效 Projex 空间协作与工作项/合并请求
聚合包 Bitzsoft.Integrations.ProjectManagement.All 一键聚合注册全部 14 家项目管理供应商
基础工具库 Bitzsoft.Integrations.Core 核心基座与供应商解析器 (IIntegrationProviderResolver<T>)
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Bitzsoft.Integrations.ProjectManagement.JiraCloud:

Package Downloads
Bitzsoft.Integrations.ProjectManagement.All

项目管理服务聚合包 — 包含全部供应商实现(Asana / Teambition / Monday / Trello / ONES / PingCode / Yunxiao / GitHub / GitLab / Gitee / JiraCloud / JiraDataCenter / AzureDevOps / Tapd)

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 111 9/23/2026
1.0.3 111 9/22/2026
1.0.2 117 8/29/2026
1.0.1 129 8/3/2026
1.0.0 119 8/2/2026