@ngocsangairvds/vsaf 3.1.27 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/global.js +70 -10
- package/tools/skills/vds-scripts-skill/.openskills.json +6 -0
- package/tools/skills/vds-scripts-skill/QUALITY.md +44 -0
- package/tools/skills/vds-scripts-skill/SKILL.md +135 -0
- package/tools/skills/vds-scripts-skill/references/audit-commands.md +171 -0
- package/tools/skills/vds-scripts-skill/references/capability-index.md +34 -0
- package/tools/skills/vds-scripts-skill/references/development-commands.md +12 -0
- package/tools/skills/vds-scripts-skill/references/google-sheets.md +73 -0
- package/tools/skills/vds-scripts-skill/references/integration-commands.md +17 -0
- package/tools/skills/vds-scripts-skill/references/platform-bootstrap.md +31 -0
- package/tools/skills/vds-scripts-skill/references/specialist-routing.md +14 -0
- package/tools/skills/vds-scripts-skill/references/validation-commands.md +15 -0
- package/tools/skills/vsaf-build/SKILL.md +32 -2
- package/tools/skills/vsaf-ship/SKILL.md +41 -10
- package/tools/skills/vsaf-test/SKILL.md +8 -0
- package/tools/vds-scripts/.mcp.json +11 -0
- package/tools/vds-scripts/.secrets.baseline +133 -0
- package/tools/vds-scripts/AGENTS.md +152 -0
- package/tools/vds-scripts/CLAUDE.md +101 -0
- package/tools/vds-scripts/CLI_COMMAND_OPTIMIZATION.md +156 -0
- package/tools/vds-scripts/PACKAGE_P125B_IMPLEMENTATION_SUMMARY.md +131 -0
- package/tools/vds-scripts/PROJECT_COMPLETION_SUMMARY.md +45 -0
- package/tools/vds-scripts/README.md +97 -0
- package/tools/vds-scripts/bitbucket_manifest_mapping.toml +34 -0
- package/tools/vds-scripts/bitbucket_orchestrator/ARCHITECTURE_ANALYSIS.md +258 -0
- package/tools/vds-scripts/bitbucket_orchestrator/BITBUCKET_API_PRACTICES.md +393 -0
- package/tools/vds-scripts/bitbucket_orchestrator/EVALUATION_REPORT.md +61 -0
- package/tools/vds-scripts/bitbucket_orchestrator/FEATURES.md +908 -0
- package/tools/vds-scripts/bitbucket_orchestrator/README.md +687 -0
- package/tools/vds-scripts/bitbucket_orchestrator/pyproject.toml +40 -0
- package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/__init__.py +20 -0
- package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/async_client.py +657 -0
- package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/cli.py +2108 -0
- package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/client.py +2534 -0
- package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/config.py +171 -0
- package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/errors.py +67 -0
- package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/factory.py +185 -0
- package/tools/vds-scripts/bitbucket_orchestrator/src/vds_bitbucket_orchestrator/protocols.py +244 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/__init__.py +8 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/conftest.py +65 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_advanced_search.py +151 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_async_client.py +546 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_branch_permissions.py +145 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_cli.py +115 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client.py +157 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_branch_conditions.py +79 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_code_advanced.py +163 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_code_file.py +32 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_deployment_environments.py +194 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_issues.py +164 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_pipelines_advanced.py +179 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_pr_blockers.py +119 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_client_repository_variables.py +156 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_code.py +98 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_code_advanced.py +282 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_code_insights.py +335 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_conditions.py +147 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_config.py +131 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_deployment_env.py +352 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_factory.py +371 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_fork_operations.py +204 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_issue_cli.py +261 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_pipeline_advanced.py +270 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_pr_blocker.py +204 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_protocols.py +334 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_repo_settings.py +343 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_repo_variables.py +270 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_webhooks.py +189 -0
- package/tools/vds-scripts/bitbucket_orchestrator/tests/test_workspace.py +233 -0
- package/tools/vds-scripts/bitbucket_orchestrator/uv.lock +742 -0
- package/tools/vds-scripts/confluence_orchestrator/Dockerfile +19 -0
- package/tools/vds-scripts/confluence_orchestrator/README.md +412 -0
- package/tools/vds-scripts/confluence_orchestrator/SYNC_SCRIPTS.md +127 -0
- package/tools/vds-scripts/confluence_orchestrator/SYNC_STANDARDIZATION.md +108 -0
- package/tools/vds-scripts/confluence_orchestrator/pyproject.toml +48 -0
- package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/__init__.py +20 -0
- package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/cli.py +2532 -0
- package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/config.py +175 -0
- package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/content.py +290 -0
- package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/content_v2.py +94 -0
- package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/crawl_tree.py +1835 -0
- package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/errors.py +80 -0
- package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/eventing.py +109 -0
- package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/http.py +1114 -0
- package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/orchestration.py +165 -0
- package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/reporting.py +78 -0
- package/tools/vds-scripts/confluence_orchestrator/src/confluence_orchestrator/tree.py +121 -0
- package/tools/vds-scripts/confluence_orchestrator/sync_pdfs_from_markdown.py +213 -0
- package/tools/vds-scripts/confluence_orchestrator/sync_pdfs_to_confluence.py +305 -0
- package/tools/vds-scripts/confluence_orchestrator/sync_png_attachments.py +305 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/__init__.py +0 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/conftest.py +8 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_advanced_content.py +224 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_advanced_search.py +188 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_cache_management.py +247 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_cli.py +499 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_config.py +83 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_content.py +186 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_content_flags.py +27 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_crawl_tree.py +2250 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_draft_management.py +223 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_eventing.py +71 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_eventing_chaos.py +37 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_eventing_rate_limit.py +44 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_eventing_timeout.py +49 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_export.py +230 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_history.py +204 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_http.py +117 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_orchestration.py +91 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_reporting.py +24 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_search_cql.py +34 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_space_management.py +237 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_space_permissions.py +332 -0
- package/tools/vds-scripts/confluence_orchestrator/tests/test_user_group_management.py +388 -0
- package/tools/vds-scripts/confluence_orchestrator/uv.lock +1023 -0
- package/tools/vds-scripts/git_orchestrator/ENHANCEMENT_SUMMARY.md +119 -0
- package/tools/vds-scripts/git_orchestrator/README.md +280 -0
- package/tools/vds-scripts/git_orchestrator/VERIFICATION_REPORT.md +152 -0
- package/tools/vds-scripts/git_orchestrator/pyproject.toml +35 -0
- package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/__init__.py +7 -0
- package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/__main__.py +4 -0
- package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/cli.py +847 -0
- package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/logging_config.py +63 -0
- package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/manifest.py +129 -0
- package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/orchestrator.py +819 -0
- package/tools/vds-scripts/git_orchestrator/src/vds_git_orchestrator/reporting.py +53 -0
- package/tools/vds-scripts/git_orchestrator/tests/__init__.py +0 -0
- package/tools/vds-scripts/git_orchestrator/tests/test_cli_settings.py +21 -0
- package/tools/vds-scripts/git_orchestrator/tests/test_integration.py +74 -0
- package/tools/vds-scripts/git_orchestrator/tests/test_manifest.py +79 -0
- package/tools/vds-scripts/git_orchestrator/tests/test_orchestrator.py +204 -0
- package/tools/vds-scripts/git_orchestrator/tests/test_public_api.py +236 -0
- package/tools/vds-scripts/git_orchestrator/tests/test_resilience.py +345 -0
- package/tools/vds-scripts/git_orchestrator/uv.lock +271 -0
- package/tools/vds-scripts/jira_orchestrator/README.md +770 -0
- package/tools/vds-scripts/jira_orchestrator/pyproject.toml +39 -0
- package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/__init__.py +1 -0
- package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/adapter.py +1320 -0
- package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/cli.py +2271 -0
- package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/config.py +138 -0
- package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/errors.py +67 -0
- package/tools/vds-scripts/jira_orchestrator/src/vds_jira_orchestrator/reporting.py +65 -0
- package/tools/vds-scripts/jira_orchestrator/tests/__init__.py +1 -0
- package/tools/vds-scripts/jira_orchestrator/tests/conftest.py +86 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_agile_list_payloads.py +54 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_bulk_operations.py +69 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_components.py +57 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_createmeta.py +45 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_dashboard.py +117 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_issue_properties.py +54 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_permissions_compat.py +42 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_reindex.py +42 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_remote_links.py +76 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_transitions.py +91 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_user_management.py +110 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_version_management.py +133 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_adapter_watchers.py +41 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_advanced_search.py +164 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_agile.py +256 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_application_properties.py +193 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_backlog.py +91 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_bulk_operations.py +277 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_cli.py +106 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_components.py +106 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_config.py +164 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_dashboard.py +122 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_discover_fields.py +207 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_filter_management.py +333 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_issue_archiving.py +164 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_issue_links.py +257 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_issue_properties.py +171 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_link_types.py +314 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_parse_set.py +37 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_permissions.py +273 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_reindex.py +81 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_remote_links.py +254 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_security_schemes.py +170 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_transitions_changelog.py +114 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_user_management.py +226 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_version_management.py +339 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_watchers.py +101 -0
- package/tools/vds-scripts/jira_orchestrator/tests/test_worklog.py +223 -0
- package/tools/vds-scripts/jira_orchestrator/uv.lock +738 -0
- package/tools/vds-scripts/mcp_server/Dockerfile +34 -0
- package/tools/vds-scripts/mcp_server/README.md +140 -0
- package/tools/vds-scripts/mcp_server/pyproject.toml +42 -0
- package/tools/vds-scripts/mcp_server/src/vds_mcp_server/__init__.py +4 -0
- package/tools/vds-scripts/mcp_server/src/vds_mcp_server/config.py +36 -0
- package/tools/vds-scripts/mcp_server/src/vds_mcp_server/server.py +66 -0
- package/tools/vds-scripts/mcp_server/src/vds_mcp_server/tools/__init__.py +14 -0
- package/tools/vds-scripts/mcp_server/src/vds_mcp_server/tools/bitbucket_tools.py +47 -0
- package/tools/vds-scripts/mcp_server/src/vds_mcp_server/tools/confluence_tools.py +59 -0
- package/tools/vds-scripts/mcp_server/src/vds_mcp_server/tools/git_tools.py +71 -0
- package/tools/vds-scripts/mcp_server/src/vds_mcp_server/tools/jira_tools.py +63 -0
- package/tools/vds-scripts/mcp_server/tests/__init__.py +2 -0
- package/tools/vds-scripts/mcp_server/tests/conftest.py +29 -0
- package/tools/vds-scripts/mcp_server/tests/unit/__init__.py +2 -0
- package/tools/vds-scripts/mcp_server/tests/unit/test_bitbucket_tools.py +25 -0
- package/tools/vds-scripts/mcp_server/tests/unit/test_confluence_tools.py +25 -0
- package/tools/vds-scripts/mcp_server/tests/unit/test_git_tools.py +32 -0
- package/tools/vds-scripts/mcp_server/tests/unit/test_jira_tools.py +32 -0
- package/tools/vds-scripts/mcp_server/tests/verification/__init__.py +2 -0
- package/tools/vds-scripts/mcp_server/tests/verification/test_mcp_confluence_tools.py +40 -0
- package/tools/vds-scripts/mcp_server/tests/verification/test_mcp_jira_tools.py +37 -0
- package/tools/vds-scripts/mcp_server/tests/verification/test_mcp_tool_registration.py +47 -0
- package/tools/vds-scripts/mcp_server/uv.lock +1032 -0
- package/tools/vds-scripts/mypy.ini +5 -0
- package/tools/vds-scripts/pyproject.toml +29 -0
- package/tools/vds-scripts/repo-manifest.yaml +273 -0
- package/tools/vds-scripts/repo-manifest.yaml.example +25 -0
- package/tools/vds-scripts/scripts/BRD-Validation-API.postman_collection.json +706 -0
- package/tools/vds-scripts/scripts/BRD-Validation-README.md +308 -0
- package/tools/vds-scripts/scripts/README.md +162 -0
- package/tools/vds-scripts/scripts/bootstrap_uv.sh +30 -0
- package/tools/vds-scripts/scripts/brd-validation-environment.json +51 -0
- package/tools/vds-scripts/scripts/brd-validation-test-results.json +13023 -0
- package/tools/vds-scripts/scripts/brd_coverage_report.json +276 -0
- package/tools/vds-scripts/scripts/create_memory_session.py +35 -0
- package/tools/vds-scripts/scripts/deployment/load_docker_images_offline.sh +90 -0
- package/tools/vds-scripts/scripts/final_completion_report.md +139 -0
- package/tools/vds-scripts/scripts/folder_structure_report.json +321 -0
- package/tools/vds-scripts/scripts/generate_completion_report.py +125 -0
- package/tools/vds-scripts/scripts/generate_intellij_modules.py +150 -0
- package/tools/vds-scripts/scripts/link_integrity_report.json +807 -0
- package/tools/vds-scripts/scripts/move_audit_artifact_pages.py +255 -0
- package/tools/vds-scripts/scripts/move_audit_artifact_pages_rest.py +165 -0
- package/tools/vds-scripts/scripts/move_wrong_dept_pages.py +216 -0
- package/tools/vds-scripts/scripts/save_intellij_memories.py +120 -0
- package/tools/vds-scripts/scripts/save_memories_to_vds_ai.py +83 -0
- package/tools/vds-scripts/scripts/save_memories_vds_style.py +129 -0
- package/tools/vds-scripts/scripts/search_intellij_memories.py +50 -0
- package/tools/vds-scripts/scripts/setup_intellij_workspace.py +65 -0
- package/tools/vds-scripts/scripts/target-state-automation/README.md +89 -0
- package/tools/vds-scripts/scripts/target-state-automation/confluence_sync_coordinator.sh +27 -0
- package/tools/vds-scripts/scripts/target-state-automation/coordination.sh +114 -0
- package/tools/vds-scripts/scripts/target-state-automation/diagram_coordinator.sh +25 -0
- package/tools/vds-scripts/scripts/target-state-automation/docs_root.sh +22 -0
- package/tools/vds-scripts/scripts/target-state-automation/generate_diagrams.sh +22 -0
- package/tools/vds-scripts/scripts/target-state-automation/markdown_coordinator.sh +25 -0
- package/tools/vds-scripts/scripts/target-state-automation/progress_dashboard.sh +17 -0
- package/tools/vds-scripts/scripts/target-state-automation/schema_coordinator.sh +25 -0
- package/tools/vds-scripts/scripts/target-state-automation/sync_confluence.sh +30 -0
- package/tools/vds-scripts/scripts/target-state-automation/update_dependencies.sh +19 -0
- package/tools/vds-scripts/scripts/target-state-automation/validate_links.sh +86 -0
- package/tools/vds-scripts/scripts/target-state-automation/validate_markdown.sh +52 -0
- package/tools/vds-scripts/scripts/target-state-automation/validate_schemas.sh +26 -0
- package/tools/vds-scripts/scripts/target-state-automation/validate_structure.sh +98 -0
- package/tools/vds-scripts/scripts/update_modules_xml.py +190 -0
- package/tools/vds-scripts/scripts/uv-workspace-alignment-verification-2026-03-25.md +128 -0
- package/tools/vds-scripts/scripts/validate_brd_coverage.py +179 -0
- package/tools/vds-scripts/scripts/validate_folder_structure.py +240 -0
- package/tools/vds-scripts/scripts/validate_link_integrity.py +272 -0
- package/tools/vds-scripts/scripts/vds_sh_helpers.sh +180 -0
- package/tools/vds-scripts/scripts/verification/phase2_portable_paths_ubuntu_docker.sh +26 -0
- package/tools/vds-scripts/scripts/worktree_uv.sh +48 -0
- package/tools/vds-scripts/uv.lock +8 -0
- package/tools/vds-scripts/vds_cli/README.md +126 -0
- package/tools/vds-scripts/vds_cli/VERIFICATION_REPORT.md +41 -0
- package/tools/vds-scripts/vds_cli/pyproject.toml +38 -0
- package/tools/vds-scripts/vds_cli/src/vds_cli/__init__.py +3 -0
- package/tools/vds-scripts/vds_cli/src/vds_cli/cli.py +173 -0
- package/tools/vds-scripts/vds_cli/src/vds_cli/docs_sync.py +1203 -0
- package/tools/vds-scripts/vds_cli/src/vds_cli/env.py +41 -0
- package/tools/vds-scripts/vds_cli/src/vds_cli/google_sheets_orchestrator/__init__.py +3 -0
- package/tools/vds-scripts/vds_cli/src/vds_cli/google_sheets_orchestrator/google_sheets_orchestrator.py +198 -0
- package/tools/vds-scripts/vds_cli/src/vds_cli/router.py +93 -0
- package/tools/vds-scripts/vds_cli/src/vds_cli/sync_api.py +647 -0
- package/tools/vds-scripts/vds_cli/src/vds_cli/sync_service.py +266 -0
- package/tools/vds-scripts/vds_cli/tests/__init__.py +2 -0
- package/tools/vds-scripts/vds_cli/tests/conftest.py +49 -0
- package/tools/vds-scripts/vds_cli/tests/unit/__init__.py +2 -0
- package/tools/vds-scripts/vds_cli/tests/unit/test_cli.py +143 -0
- package/tools/vds-scripts/vds_cli/tests/unit/test_docs_sync.py +422 -0
- package/tools/vds-scripts/vds_cli/tests/unit/test_env.py +51 -0
- package/tools/vds-scripts/vds_cli/tests/unit/test_router.py +72 -0
- package/tools/vds-scripts/vds_cli/tests/unit/test_sync_api.py +357 -0
- package/tools/vds-scripts/vds_cli/tests/unit/test_sync_service.py +160 -0
- package/tools/vds-scripts/vds_cli/tests/verification/__init__.py +2 -0
- package/tools/vds-scripts/vds_cli/tests/verification/test_bitbucket_real.py +33 -0
- package/tools/vds-scripts/vds_cli/tests/verification/test_confluence_real.py +35 -0
- package/tools/vds-scripts/vds_cli/tests/verification/test_jira_real.py +41 -0
- package/tools/vds-scripts/vds_cli/uv.lock +524 -0
- package/tools/vds-scripts/vds_cli_common/README.md +190 -0
- package/tools/vds-scripts/vds_cli_common/pyproject.toml +92 -0
- package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/__init__.py +34 -0
- package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/completers.py +139 -0
- package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/context.py +201 -0
- package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/env.py +119 -0
- package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/errors.py +318 -0
- package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/output.py +284 -0
- package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/paths.py +78 -0
- package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/testing.py +213 -0
- package/tools/vds-scripts/vds_cli_common/src/vds_cli_common/version.py +85 -0
- package/tools/vds-scripts/vds_cli_common/tests/__init__.py +1 -0
- package/tools/vds-scripts/vds_cli_common/tests/test_completers.py +148 -0
- package/tools/vds-scripts/vds_cli_common/tests/test_context.py +192 -0
- package/tools/vds-scripts/vds_cli_common/tests/test_env.py +102 -0
- package/tools/vds-scripts/vds_cli_common/tests/test_errors.py +186 -0
- package/tools/vds-scripts/vds_cli_common/tests/test_output.py +229 -0
- package/tools/vds-scripts/vds_cli_common/tests/test_paths.py +61 -0
- package/tools/vds-scripts/vds_cli_common/tests/test_testing.py +138 -0
- package/tools/vds-scripts/vds_cli_common/tests/test_version.py +64 -0
|
@@ -0,0 +1,1320 @@
|
|
|
1
|
+
"""Jira adapter using atlassian-python-api (SDK-only)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Iterable, Sequence
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
from atlassian import Jira
|
|
9
|
+
from requests import Session
|
|
10
|
+
|
|
11
|
+
from .errors import (
|
|
12
|
+
JiraAdapterError,
|
|
13
|
+
JiraAuthError,
|
|
14
|
+
JiraConflictError,
|
|
15
|
+
JiraNotFound,
|
|
16
|
+
JiraRateLimited,
|
|
17
|
+
JiraResponseError,
|
|
18
|
+
JiraTransportError,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class JiraAdapter:
|
|
23
|
+
def __init__(
|
|
24
|
+
self,
|
|
25
|
+
*,
|
|
26
|
+
url: str,
|
|
27
|
+
username: str | None = None,
|
|
28
|
+
password: str | None = None,
|
|
29
|
+
token: str | None = None,
|
|
30
|
+
session: Session | None = None,
|
|
31
|
+
cloud: bool = False,
|
|
32
|
+
timeout: int = 30,
|
|
33
|
+
) -> None:
|
|
34
|
+
auth = {}
|
|
35
|
+
if token:
|
|
36
|
+
auth = {"token": token}
|
|
37
|
+
elif username and password:
|
|
38
|
+
auth = {"username": username, "password": password}
|
|
39
|
+
else:
|
|
40
|
+
raise JiraAuthError("Provide either token or username/password")
|
|
41
|
+
|
|
42
|
+
self._client = Jira(url=url, session=session, cloud=cloud, timeout=timeout, **auth)
|
|
43
|
+
self._is_cloud = cloud or ".atlassian.net" in url.lower()
|
|
44
|
+
|
|
45
|
+
# --- read operations ---
|
|
46
|
+
def jql(self, query: str, *, limit: int = 50, fields: Iterable[str] | None = None) -> dict[str, Any]:
|
|
47
|
+
try:
|
|
48
|
+
return self._client.jql(query, limit=limit, fields=",".join(fields) if fields else None)
|
|
49
|
+
except Exception as exc: # map coarse errors; refine as needed
|
|
50
|
+
_raise_mapped(exc)
|
|
51
|
+
|
|
52
|
+
def get_issue(self, key: str) -> dict[str, Any]:
|
|
53
|
+
try:
|
|
54
|
+
issue = self._client.issue(key)
|
|
55
|
+
if not issue:
|
|
56
|
+
raise JiraNotFound(f"Issue not found: {key}")
|
|
57
|
+
return issue
|
|
58
|
+
except Exception as exc:
|
|
59
|
+
_raise_mapped(exc)
|
|
60
|
+
|
|
61
|
+
def list_projects(self) -> list[dict[str, Any]]:
|
|
62
|
+
try:
|
|
63
|
+
projects = self._client.projects()
|
|
64
|
+
return projects if isinstance(projects, list) else list(projects)
|
|
65
|
+
except Exception as exc:
|
|
66
|
+
_raise_mapped(exc)
|
|
67
|
+
|
|
68
|
+
# --- write operations (guarded by CLI) ---
|
|
69
|
+
def create_issue(
|
|
70
|
+
self,
|
|
71
|
+
*,
|
|
72
|
+
project_key: str,
|
|
73
|
+
summary: str,
|
|
74
|
+
issuetype: str,
|
|
75
|
+
description: str | None = None,
|
|
76
|
+
assignee: str | None = None,
|
|
77
|
+
labels: Sequence[str] | None = None,
|
|
78
|
+
extra_fields: dict[str, Any] | None = None,
|
|
79
|
+
) -> dict[str, Any]:
|
|
80
|
+
fields: dict[str, Any] = {
|
|
81
|
+
"project": {"key": project_key},
|
|
82
|
+
"summary": summary,
|
|
83
|
+
"issuetype": {"name": issuetype},
|
|
84
|
+
}
|
|
85
|
+
if description:
|
|
86
|
+
fields["description"] = description
|
|
87
|
+
if assignee:
|
|
88
|
+
# Server/DC uses username key (current behavior, not legacy)
|
|
89
|
+
fields["assignee"] = {"name": assignee}
|
|
90
|
+
if labels:
|
|
91
|
+
fields["labels"] = list(labels)
|
|
92
|
+
if extra_fields:
|
|
93
|
+
fields.update(extra_fields)
|
|
94
|
+
try:
|
|
95
|
+
return self._client.create_issue(fields=fields) # type: ignore[call-arg]
|
|
96
|
+
except Exception as exc:
|
|
97
|
+
_raise_mapped(exc)
|
|
98
|
+
|
|
99
|
+
def update_issue_fields(self, key: str, fields: dict[str, Any]) -> dict[str, Any]:
|
|
100
|
+
try:
|
|
101
|
+
# atlassian-python-api: Jira.update_issue_field(issue_key, fields)
|
|
102
|
+
return self._client.update_issue_field(key, fields) # type: ignore[call-arg]
|
|
103
|
+
except Exception as exc:
|
|
104
|
+
_raise_mapped(exc)
|
|
105
|
+
|
|
106
|
+
def add_comment(self, key: str, message: str) -> dict[str, Any]:
|
|
107
|
+
"""Add comment to issue."""
|
|
108
|
+
try:
|
|
109
|
+
return self._client.issue_add_comment(key, message) # type: ignore[attr-defined]
|
|
110
|
+
except Exception as exc:
|
|
111
|
+
_raise_mapped(exc)
|
|
112
|
+
|
|
113
|
+
def get_comments(self, key: str) -> list[dict[str, Any]]:
|
|
114
|
+
"""Get comments from issue."""
|
|
115
|
+
try:
|
|
116
|
+
result = self._client.issue_get_comments(key) # type: ignore[attr-defined]
|
|
117
|
+
if isinstance(result, dict) and "comments" in result:
|
|
118
|
+
return result["comments"]
|
|
119
|
+
return result if isinstance(result, list) else []
|
|
120
|
+
except Exception as exc:
|
|
121
|
+
_raise_mapped(exc)
|
|
122
|
+
|
|
123
|
+
def transition_issue(self, key: str, to_status: str) -> None:
|
|
124
|
+
try:
|
|
125
|
+
transitions = self._client.get_transitions(key) # type: ignore[attr-defined]
|
|
126
|
+
if not transitions:
|
|
127
|
+
raise JiraAdapterError(f"No transitions available for {key}")
|
|
128
|
+
match = None
|
|
129
|
+
for t in transitions:
|
|
130
|
+
name = str(t.get("name", ""))
|
|
131
|
+
if name.lower() == to_status.lower():
|
|
132
|
+
match = str(t.get("id"))
|
|
133
|
+
break
|
|
134
|
+
if not match:
|
|
135
|
+
raise JiraAdapterError(f"Transition '{to_status}' not found for {key}")
|
|
136
|
+
self._client.transition_issue(key, match) # type: ignore[attr-defined]
|
|
137
|
+
except Exception as exc:
|
|
138
|
+
_raise_mapped(exc)
|
|
139
|
+
|
|
140
|
+
def delete_issue(self, key: str) -> None:
|
|
141
|
+
try:
|
|
142
|
+
self._client.delete_issue(key)
|
|
143
|
+
except Exception as exc:
|
|
144
|
+
_raise_mapped(exc)
|
|
145
|
+
|
|
146
|
+
# --- metadata operations ---
|
|
147
|
+
def get_createmeta(
|
|
148
|
+
self, project_key: str, issuetype: str, expand: str | None = None
|
|
149
|
+
) -> dict[str, Any]:
|
|
150
|
+
"""Get create metadata for issue creation (field definitions, allowed values)."""
|
|
151
|
+
try:
|
|
152
|
+
# SDK method signature: issue_createmeta(projectKeys, issuetypeNames, expand=None)
|
|
153
|
+
# expand is a positional argument, not keyword
|
|
154
|
+
if expand:
|
|
155
|
+
return self._client.issue_createmeta(project_key, issuetype, expand) # type: ignore[call-arg]
|
|
156
|
+
else:
|
|
157
|
+
return self._client.issue_createmeta(project_key, issuetype) # type: ignore[call-arg]
|
|
158
|
+
except Exception as exc:
|
|
159
|
+
_raise_mapped(exc)
|
|
160
|
+
|
|
161
|
+
# --- issue utilities ---
|
|
162
|
+
def issue_exists(self, key: str) -> bool:
|
|
163
|
+
"""Check if issue exists."""
|
|
164
|
+
try:
|
|
165
|
+
return self._client.issue_exists(key) # type: ignore[attr-defined]
|
|
166
|
+
except Exception as exc:
|
|
167
|
+
_raise_mapped(exc)
|
|
168
|
+
|
|
169
|
+
def issue_deleted(self, key: str) -> bool:
|
|
170
|
+
"""Check if issue is deleted."""
|
|
171
|
+
try:
|
|
172
|
+
return self._client.issue_deleted(key) # type: ignore[attr-defined]
|
|
173
|
+
except Exception as exc:
|
|
174
|
+
_raise_mapped(exc)
|
|
175
|
+
|
|
176
|
+
def match_jql(self, issue_ids: list[str], jqls: list[str]) -> dict[str, Any]:
|
|
177
|
+
"""Check issues against JQL queries."""
|
|
178
|
+
try:
|
|
179
|
+
return self._client.match_jql(issue_ids, jqls) # type: ignore[attr-defined]
|
|
180
|
+
except Exception as exc:
|
|
181
|
+
_raise_mapped(exc)
|
|
182
|
+
|
|
183
|
+
def get_issue_field_value(self, key: str, field: str) -> Any:
|
|
184
|
+
"""Get issue field value."""
|
|
185
|
+
try:
|
|
186
|
+
return self._client.issue_field_value(key, field) # type: ignore[attr-defined]
|
|
187
|
+
except Exception as exc:
|
|
188
|
+
_raise_mapped(exc)
|
|
189
|
+
|
|
190
|
+
def append_issue_field_value(self, key: str, field: str, value: Any, notify_users: bool = True) -> dict[str, Any]:
|
|
191
|
+
"""Append value to issue field (e.g., for multi-select fields)."""
|
|
192
|
+
try:
|
|
193
|
+
return self._client.issue_field_value_append(key, field, value, notify_users=notify_users) # type: ignore[attr-defined]
|
|
194
|
+
except Exception as exc:
|
|
195
|
+
_raise_mapped(exc)
|
|
196
|
+
|
|
197
|
+
# --- attachment operations ---
|
|
198
|
+
def add_attachment(self, key: str, filename: str) -> dict[str, Any]:
|
|
199
|
+
"""Add attachment to issue."""
|
|
200
|
+
try:
|
|
201
|
+
return self._client.add_attachment(key, filename) # type: ignore[attr-defined]
|
|
202
|
+
except Exception as exc:
|
|
203
|
+
_raise_mapped(exc)
|
|
204
|
+
|
|
205
|
+
def get_attachments(self, key: str) -> list[dict[str, Any]]:
|
|
206
|
+
"""Get list of attachments for issue."""
|
|
207
|
+
try:
|
|
208
|
+
issue = self.get_issue(key)
|
|
209
|
+
return issue.get("fields", {}).get("attachment", [])
|
|
210
|
+
except Exception as exc:
|
|
211
|
+
_raise_mapped(exc)
|
|
212
|
+
|
|
213
|
+
def download_attachments(self, key: str, path: str | None = None, cloud: bool = False) -> list[str]:
|
|
214
|
+
"""Download attachments from issue."""
|
|
215
|
+
try:
|
|
216
|
+
issue = self.get_issue(key)
|
|
217
|
+
return self._client.download_attachments_from_issue(issue, path=path, cloud=cloud) # type: ignore[attr-defined]
|
|
218
|
+
except Exception as exc:
|
|
219
|
+
_raise_mapped(exc)
|
|
220
|
+
|
|
221
|
+
# --- project operations ---
|
|
222
|
+
def get_project(self, key: str, expand: str | None = None) -> dict[str, Any]:
|
|
223
|
+
"""Get project details."""
|
|
224
|
+
try:
|
|
225
|
+
return self._client.project(key, expand=expand) # type: ignore[attr-defined]
|
|
226
|
+
except Exception as exc:
|
|
227
|
+
_raise_mapped(exc)
|
|
228
|
+
|
|
229
|
+
def get_project_components(self, key: str) -> list[dict[str, Any]]:
|
|
230
|
+
"""Get project components."""
|
|
231
|
+
try:
|
|
232
|
+
return self._client.get_project_components(key) # type: ignore[attr-defined]
|
|
233
|
+
except Exception as exc:
|
|
234
|
+
_raise_mapped(exc)
|
|
235
|
+
|
|
236
|
+
def get_project_versions(self, key: str, expand: str | None = None) -> list[dict[str, Any]]:
|
|
237
|
+
"""Get project versions."""
|
|
238
|
+
try:
|
|
239
|
+
return self._client.get_project_versions(key, expand=expand) # type: ignore[attr-defined]
|
|
240
|
+
except Exception as exc:
|
|
241
|
+
_raise_mapped(exc)
|
|
242
|
+
|
|
243
|
+
def add_version(
|
|
244
|
+
self,
|
|
245
|
+
key: str,
|
|
246
|
+
project_id: str,
|
|
247
|
+
version: str,
|
|
248
|
+
is_archived: bool = False,
|
|
249
|
+
is_released: bool = False,
|
|
250
|
+
) -> dict[str, Any]:
|
|
251
|
+
"""Add version to project."""
|
|
252
|
+
try:
|
|
253
|
+
return self._client.add_version(key, project_id, version, is_archived=is_archived, is_released=is_released) # type: ignore[attr-defined]
|
|
254
|
+
except Exception as exc:
|
|
255
|
+
_raise_mapped(exc)
|
|
256
|
+
|
|
257
|
+
def update_version(
|
|
258
|
+
self,
|
|
259
|
+
version: str,
|
|
260
|
+
name: str | None = None,
|
|
261
|
+
description: str | None = None,
|
|
262
|
+
is_archived: bool | None = None,
|
|
263
|
+
is_released: bool | None = None,
|
|
264
|
+
start_date: str | None = None,
|
|
265
|
+
release_date: str | None = None,
|
|
266
|
+
) -> dict[str, Any]:
|
|
267
|
+
"""Update version."""
|
|
268
|
+
try:
|
|
269
|
+
return self._client.update_version( # type: ignore[attr-defined]
|
|
270
|
+
version, name=name, description=description, is_archived=is_archived, is_released=is_released, start_date=start_date, release_date=release_date
|
|
271
|
+
)
|
|
272
|
+
except Exception as exc:
|
|
273
|
+
_raise_mapped(exc)
|
|
274
|
+
|
|
275
|
+
# --- component operations ---
|
|
276
|
+
def get_component(self, component_id: str) -> dict[str, Any]:
|
|
277
|
+
"""Get component details."""
|
|
278
|
+
try:
|
|
279
|
+
return self._client.component(component_id) # type: ignore[attr-defined]
|
|
280
|
+
except Exception as exc:
|
|
281
|
+
_raise_mapped(exc)
|
|
282
|
+
|
|
283
|
+
def create_component(self, component: dict[str, Any]) -> dict[str, Any]:
|
|
284
|
+
"""Create component."""
|
|
285
|
+
try:
|
|
286
|
+
return self._client.create_component(component) # type: ignore[attr-defined]
|
|
287
|
+
except Exception as exc:
|
|
288
|
+
_raise_mapped(exc)
|
|
289
|
+
|
|
290
|
+
def update_component(self, component: dict[str, Any], component_id: str) -> dict[str, Any]:
|
|
291
|
+
"""Update component."""
|
|
292
|
+
try:
|
|
293
|
+
return self._client.update_component(component, component_id) # type: ignore[attr-defined]
|
|
294
|
+
except Exception as exc:
|
|
295
|
+
_raise_mapped(exc)
|
|
296
|
+
|
|
297
|
+
def delete_component(self, component_id: str) -> None:
|
|
298
|
+
"""Delete component."""
|
|
299
|
+
try:
|
|
300
|
+
self._client.delete_component(component_id) # type: ignore[attr-defined]
|
|
301
|
+
except Exception as exc:
|
|
302
|
+
_raise_mapped(exc)
|
|
303
|
+
|
|
304
|
+
# --- user operations ---
|
|
305
|
+
def get_myself(self) -> dict[str, Any]:
|
|
306
|
+
"""Get current user info."""
|
|
307
|
+
try:
|
|
308
|
+
return self._client.myself() # type: ignore[attr-defined]
|
|
309
|
+
except Exception as exc:
|
|
310
|
+
_raise_mapped(exc)
|
|
311
|
+
|
|
312
|
+
def get_user(self, account_id: str) -> dict[str, Any]:
|
|
313
|
+
"""Get user by account ID."""
|
|
314
|
+
try:
|
|
315
|
+
return self._client.user(account_id) # type: ignore[attr-defined]
|
|
316
|
+
except Exception as exc:
|
|
317
|
+
_raise_mapped(exc)
|
|
318
|
+
|
|
319
|
+
def find_users(self, query: str, start: int = 0, limit: int = 50, include_inactive: bool = False) -> list[dict[str, Any]]:
|
|
320
|
+
"""Find users by email/display name (Cloud) or username (Server/DC)."""
|
|
321
|
+
try:
|
|
322
|
+
return self._client.user_find_by_user_string( # type: ignore[attr-defined]
|
|
323
|
+
query=query, start=start, limit=limit, include_inactive_users=include_inactive
|
|
324
|
+
)
|
|
325
|
+
except Exception as exc:
|
|
326
|
+
_raise_mapped(exc)
|
|
327
|
+
|
|
328
|
+
# --- bulk operations ---
|
|
329
|
+
def bulk_update_issue_field(self, key_list: list[str], fields: str = "*all") -> dict[str, Any]:
|
|
330
|
+
"""Bulk update issue fields."""
|
|
331
|
+
try:
|
|
332
|
+
return self._client.bulk_update_issue_field(key_list, fields=fields) # type: ignore[attr-defined]
|
|
333
|
+
except Exception as exc:
|
|
334
|
+
_raise_mapped(exc)
|
|
335
|
+
|
|
336
|
+
def issue_field_value_append(
|
|
337
|
+
self, issue_id_or_key: str, field: str, value: dict[str, Any], notify_users: bool = True
|
|
338
|
+
) -> dict[str, Any]:
|
|
339
|
+
"""Append value to issue field (for multi-select fields)."""
|
|
340
|
+
try:
|
|
341
|
+
return self._client.issue_field_value_append(issue_id_or_key, field, value, notify_users=notify_users) # type: ignore[attr-defined]
|
|
342
|
+
except Exception as exc:
|
|
343
|
+
_raise_mapped(exc)
|
|
344
|
+
|
|
345
|
+
def issue_archive(self, issue_id_or_key: str) -> None:
|
|
346
|
+
"""Archive an issue."""
|
|
347
|
+
try:
|
|
348
|
+
self._client.issue_archive(issue_id_or_key) # type: ignore[attr-defined]
|
|
349
|
+
except Exception as exc:
|
|
350
|
+
_raise_mapped(exc)
|
|
351
|
+
|
|
352
|
+
def issue_restore(self, issue_id_or_key: str) -> None:
|
|
353
|
+
"""Restore an archived issue."""
|
|
354
|
+
try:
|
|
355
|
+
self._client.issue_restore(issue_id_or_key) # type: ignore[attr-defined]
|
|
356
|
+
except Exception as exc:
|
|
357
|
+
_raise_mapped(exc)
|
|
358
|
+
|
|
359
|
+
def get_attachments_ids_from_issue(self, key: str) -> list[str]:
|
|
360
|
+
"""Get list of attachment IDs from issue."""
|
|
361
|
+
try:
|
|
362
|
+
return self._client.get_attachments_ids_from_issue(key) # type: ignore[attr-defined]
|
|
363
|
+
except Exception as exc:
|
|
364
|
+
_raise_mapped(exc)
|
|
365
|
+
|
|
366
|
+
# --- enhanced project operations ---
|
|
367
|
+
def get_all_projects(self, included_archived: bool | None = None, expand: str | None = None) -> list[dict[str, Any]]:
|
|
368
|
+
"""Get all projects (alternative call)."""
|
|
369
|
+
try:
|
|
370
|
+
projects = self._client.get_all_projects(included_archived=included_archived, expand=expand) # type: ignore[attr-defined]
|
|
371
|
+
return projects if isinstance(projects, list) else list(projects)
|
|
372
|
+
except Exception as exc:
|
|
373
|
+
_raise_mapped(exc)
|
|
374
|
+
|
|
375
|
+
def get_project_issues_count(self, project_key: str) -> int:
|
|
376
|
+
"""Get project issues count."""
|
|
377
|
+
try:
|
|
378
|
+
return self._client.get_project_issues_count(project_key) # type: ignore[attr-defined]
|
|
379
|
+
except Exception as exc:
|
|
380
|
+
_raise_mapped(exc)
|
|
381
|
+
|
|
382
|
+
def get_all_project_issues(
|
|
383
|
+
self, project_key: str, fields: str = "*all", start: int = 0, limit: int = 500
|
|
384
|
+
) -> list[dict[str, Any]]:
|
|
385
|
+
"""Get all project issues."""
|
|
386
|
+
try:
|
|
387
|
+
return self._client.get_all_project_issues(project_key, fields=fields, start=start, limit=limit) # type: ignore[attr-defined]
|
|
388
|
+
except Exception as exc:
|
|
389
|
+
_raise_mapped(exc)
|
|
390
|
+
|
|
391
|
+
def get_all_assignable_users_for_project(
|
|
392
|
+
self, project_key: str, start: int = 0, limit: int = 50
|
|
393
|
+
) -> list[dict[str, Any]]:
|
|
394
|
+
"""Get all assignable users for project."""
|
|
395
|
+
try:
|
|
396
|
+
return self._client.get_all_assignable_users_for_project(project_key, start=start, limit=limit) # type: ignore[attr-defined]
|
|
397
|
+
except Exception as exc:
|
|
398
|
+
_raise_mapped(exc)
|
|
399
|
+
|
|
400
|
+
def get_project_issuekey_last(self, project_key: str) -> str | None:
|
|
401
|
+
"""Get last project issue key."""
|
|
402
|
+
try:
|
|
403
|
+
return self._client.get_project_issuekey_last(project_key) # type: ignore[attr-defined]
|
|
404
|
+
except Exception as exc:
|
|
405
|
+
_raise_mapped(exc)
|
|
406
|
+
|
|
407
|
+
def get_project_issuekey_all(self, project_key: str) -> list[str]:
|
|
408
|
+
"""Get all project issue keys."""
|
|
409
|
+
try:
|
|
410
|
+
return self._client.get_project_issuekey_all(project_key) # type: ignore[attr-defined]
|
|
411
|
+
except Exception as exc:
|
|
412
|
+
_raise_mapped(exc)
|
|
413
|
+
|
|
414
|
+
def update_project(self, project_key: str, data: dict[str, Any], expand: str = "lead,description") -> dict[str, Any]:
|
|
415
|
+
"""Update a project."""
|
|
416
|
+
try:
|
|
417
|
+
return self._client.update_project(project_key, data, expand=expand) # type: ignore[attr-defined]
|
|
418
|
+
except Exception as exc:
|
|
419
|
+
_raise_mapped(exc)
|
|
420
|
+
|
|
421
|
+
def delete_project(self, project_key: str) -> None:
|
|
422
|
+
"""Delete project."""
|
|
423
|
+
try:
|
|
424
|
+
self._client.delete_project(project_key) # type: ignore[attr-defined]
|
|
425
|
+
except Exception as exc:
|
|
426
|
+
_raise_mapped(exc)
|
|
427
|
+
|
|
428
|
+
def archive_project(self, project_key: str) -> None:
|
|
429
|
+
"""Archive project."""
|
|
430
|
+
try:
|
|
431
|
+
self._client.archive_project(project_key) # type: ignore[attr-defined]
|
|
432
|
+
except Exception as exc:
|
|
433
|
+
_raise_mapped(exc)
|
|
434
|
+
|
|
435
|
+
def get_project_versions_paginated(
|
|
436
|
+
self,
|
|
437
|
+
project_key: str,
|
|
438
|
+
start: int | None = None,
|
|
439
|
+
limit: int | None = None,
|
|
440
|
+
order_by: str | None = None,
|
|
441
|
+
expand: str | None = None,
|
|
442
|
+
query: str | None = None,
|
|
443
|
+
status: str | None = None,
|
|
444
|
+
) -> dict[str, Any]:
|
|
445
|
+
"""Get project versions (paginated)."""
|
|
446
|
+
try:
|
|
447
|
+
return self._client.get_project_versions_paginated( # type: ignore[attr-defined]
|
|
448
|
+
project_key, start=start, limit=limit, order_by=order_by, expand=expand, query=query, status=status
|
|
449
|
+
)
|
|
450
|
+
except Exception as exc:
|
|
451
|
+
_raise_mapped(exc)
|
|
452
|
+
|
|
453
|
+
def get_project_permission_scheme(
|
|
454
|
+
self, project_id_or_key: str, expand: str | None = None
|
|
455
|
+
) -> dict[str, Any]:
|
|
456
|
+
"""Get project permission scheme."""
|
|
457
|
+
try:
|
|
458
|
+
return self._client.get_project_permission_scheme(project_id_or_key, expand=expand) # type: ignore[attr-defined]
|
|
459
|
+
except Exception as exc:
|
|
460
|
+
_raise_mapped(exc)
|
|
461
|
+
|
|
462
|
+
def get_project_issue_security_scheme(
|
|
463
|
+
self, project_id_or_key: str, only_levels: bool = False
|
|
464
|
+
) -> dict[str, Any]:
|
|
465
|
+
"""Get project issue security scheme."""
|
|
466
|
+
try:
|
|
467
|
+
return self._client.get_project_issue_security_scheme(project_id_or_key, only_levels=only_levels) # type: ignore[attr-defined]
|
|
468
|
+
except Exception as exc:
|
|
469
|
+
_raise_mapped(exc)
|
|
470
|
+
|
|
471
|
+
def get_priority_scheme_of_project(self, project_key_or_id: str, expand: str | None = None) -> dict[str, Any]:
|
|
472
|
+
"""Get priority scheme of project."""
|
|
473
|
+
try:
|
|
474
|
+
return self._client.get_priority_scheme_of_project(project_key_or_id, expand=expand) # type: ignore[attr-defined]
|
|
475
|
+
except Exception as exc:
|
|
476
|
+
_raise_mapped(exc)
|
|
477
|
+
|
|
478
|
+
def get_users_with_browse_permission_to_a_project(
|
|
479
|
+
self, username: str, issue_key: str | None = None, project_key: str | None = None, start: int = 0, limit: int = 100
|
|
480
|
+
) -> list[dict[str, Any]]:
|
|
481
|
+
"""Get users with browse permission to a project."""
|
|
482
|
+
try:
|
|
483
|
+
return self._client.get_users_with_browse_permission_to_a_project( # type: ignore[attr-defined]
|
|
484
|
+
username, issue_key=issue_key, project_key=project_key, start=start, limit=limit
|
|
485
|
+
)
|
|
486
|
+
except Exception as exc:
|
|
487
|
+
_raise_mapped(exc)
|
|
488
|
+
|
|
489
|
+
# --- custom fields ---
|
|
490
|
+
def get_custom_fields(self, search: str | None = None, start: int = 1, limit: int = 50) -> list[dict[str, Any]]:
|
|
491
|
+
"""Get existing custom fields or find by filter."""
|
|
492
|
+
try:
|
|
493
|
+
return self._client.get_custom_fields(search=search, start=start, limit=limit) # type: ignore[attr-defined]
|
|
494
|
+
except Exception as exc:
|
|
495
|
+
_raise_mapped(exc)
|
|
496
|
+
|
|
497
|
+
# --- user management ---
|
|
498
|
+
def remove_user(self, username: str) -> None:
|
|
499
|
+
"""Remove user."""
|
|
500
|
+
try:
|
|
501
|
+
self._client.user_remove(username) # type: ignore[attr-defined]
|
|
502
|
+
except Exception as exc:
|
|
503
|
+
_raise_mapped(exc)
|
|
504
|
+
|
|
505
|
+
def deactivate_user(self, username: str) -> None:
|
|
506
|
+
"""Deactivate user (works from Jira 8.3.0+)."""
|
|
507
|
+
try:
|
|
508
|
+
self._client.user_deactivate(username) # type: ignore[attr-defined]
|
|
509
|
+
except Exception as exc:
|
|
510
|
+
_raise_mapped(exc)
|
|
511
|
+
|
|
512
|
+
def get_user_groups(self, account_id: str) -> list[dict[str, Any]]:
|
|
513
|
+
"""Get groups of a user (Cloud only)."""
|
|
514
|
+
if not self._is_cloud:
|
|
515
|
+
raise JiraAdapterError(
|
|
516
|
+
"get_user_groups is only available in Jira Cloud mode",
|
|
517
|
+
context={"url": self._client.url if hasattr(self._client, "url") else "unknown"},
|
|
518
|
+
)
|
|
519
|
+
try:
|
|
520
|
+
return self._client.get_user_groups(account_id) # type: ignore[attr-defined]
|
|
521
|
+
except Exception as exc:
|
|
522
|
+
_raise_mapped(exc)
|
|
523
|
+
|
|
524
|
+
# --- group management ---
|
|
525
|
+
def create_group(self, name: str) -> dict[str, Any]:
|
|
526
|
+
"""Create a group."""
|
|
527
|
+
try:
|
|
528
|
+
return self._client.create_group(name) # type: ignore[attr-defined]
|
|
529
|
+
except Exception as exc:
|
|
530
|
+
_raise_mapped(exc)
|
|
531
|
+
|
|
532
|
+
def remove_group(self, name: str, swap_group: str | None = None) -> None:
|
|
533
|
+
"""Delete a group."""
|
|
534
|
+
try:
|
|
535
|
+
self._client.remove_group(name, swap_group=swap_group) # type: ignore[attr-defined]
|
|
536
|
+
except Exception as exc:
|
|
537
|
+
_raise_mapped(exc)
|
|
538
|
+
|
|
539
|
+
def get_all_users_from_group(
|
|
540
|
+
self, group: str, include_inactive_users: bool = False, start: int = 0, limit: int = 50
|
|
541
|
+
) -> list[dict[str, Any]]:
|
|
542
|
+
"""Get all users from group."""
|
|
543
|
+
try:
|
|
544
|
+
return self._client.get_all_users_from_group( # type: ignore[attr-defined]
|
|
545
|
+
group, include_inactive_users=include_inactive_users, start=start, limit=limit
|
|
546
|
+
)
|
|
547
|
+
except Exception as exc:
|
|
548
|
+
_raise_mapped(exc)
|
|
549
|
+
|
|
550
|
+
def add_user_to_group(
|
|
551
|
+
self, username: str | None = None, group_name: str | None = None, account_id: str | None = None
|
|
552
|
+
) -> None:
|
|
553
|
+
"""Add given user to a group."""
|
|
554
|
+
try:
|
|
555
|
+
self._client.add_user_to_group(username=username, group_name=group_name, account_id=account_id) # type: ignore[attr-defined]
|
|
556
|
+
except Exception as exc:
|
|
557
|
+
_raise_mapped(exc)
|
|
558
|
+
|
|
559
|
+
def remove_user_from_group(
|
|
560
|
+
self, username: str | None = None, group_name: str | None = None, account_id: str | None = None
|
|
561
|
+
) -> None:
|
|
562
|
+
"""Remove given user from a group."""
|
|
563
|
+
try:
|
|
564
|
+
self._client.remove_user_from_group(username=username, group_name=group_name, account_id=account_id) # type: ignore[attr-defined]
|
|
565
|
+
except Exception as exc:
|
|
566
|
+
_raise_mapped(exc)
|
|
567
|
+
|
|
568
|
+
# --- permissions ---
|
|
569
|
+
def get_permissions(
|
|
570
|
+
self,
|
|
571
|
+
permissions: list[str] | None = None,
|
|
572
|
+
project_id: str | None = None,
|
|
573
|
+
project_key: str | None = None,
|
|
574
|
+
issue_id: str | None = None,
|
|
575
|
+
issue_key: str | None = None,
|
|
576
|
+
) -> dict[str, Any]:
|
|
577
|
+
"""Get permissions."""
|
|
578
|
+
try:
|
|
579
|
+
return self._client.permissions( # type: ignore[attr-defined]
|
|
580
|
+
permissions=permissions,
|
|
581
|
+
project_id=project_id,
|
|
582
|
+
project_key=project_key,
|
|
583
|
+
issue_id=issue_id,
|
|
584
|
+
issue_key=issue_key,
|
|
585
|
+
)
|
|
586
|
+
except Exception as exc:
|
|
587
|
+
_raise_mapped(exc)
|
|
588
|
+
|
|
589
|
+
def get_all_permissions(self) -> list[dict[str, Any]]:
|
|
590
|
+
"""Get all permissions."""
|
|
591
|
+
try:
|
|
592
|
+
return self._client.get_all_permissions() # type: ignore[attr-defined]
|
|
593
|
+
except Exception as exc:
|
|
594
|
+
_raise_mapped(exc)
|
|
595
|
+
|
|
596
|
+
# --- application properties ---
|
|
597
|
+
def get_property(
|
|
598
|
+
self,
|
|
599
|
+
key: str | None = None,
|
|
600
|
+
permission_level: str | None = None,
|
|
601
|
+
key_filter: str | None = None,
|
|
602
|
+
) -> dict[str, Any]:
|
|
603
|
+
"""Get an application property."""
|
|
604
|
+
try:
|
|
605
|
+
return self._client.get_property(key=key, permission_level=permission_level, key_filter=key_filter) # type: ignore[attr-defined]
|
|
606
|
+
except Exception as exc:
|
|
607
|
+
_raise_mapped(exc)
|
|
608
|
+
|
|
609
|
+
def set_property(self, property_id: str, value: Any) -> None:
|
|
610
|
+
"""Set an application property."""
|
|
611
|
+
try:
|
|
612
|
+
self._client.set_property(property_id, value) # type: ignore[attr-defined]
|
|
613
|
+
except Exception as exc:
|
|
614
|
+
_raise_mapped(exc)
|
|
615
|
+
|
|
616
|
+
def get_advanced_settings(self) -> dict[str, Any]:
|
|
617
|
+
"""Get advanced settings."""
|
|
618
|
+
try:
|
|
619
|
+
return self._client.get_advanced_settings() # type: ignore[attr-defined]
|
|
620
|
+
except Exception as exc:
|
|
621
|
+
_raise_mapped(exc)
|
|
622
|
+
|
|
623
|
+
# --- issue link types ---
|
|
624
|
+
def get_issue_link_types(self) -> list[dict[str, Any]]:
|
|
625
|
+
"""Get issue link types."""
|
|
626
|
+
try:
|
|
627
|
+
return self._client.get_issue_link_types() # type: ignore[attr-defined]
|
|
628
|
+
except Exception as exc:
|
|
629
|
+
_raise_mapped(exc)
|
|
630
|
+
|
|
631
|
+
def create_issue_link_type(self, data: dict[str, str]) -> dict[str, Any]:
|
|
632
|
+
"""Create issue link type."""
|
|
633
|
+
try:
|
|
634
|
+
return self._client.create_issue_link_type(data) # type: ignore[attr-defined]
|
|
635
|
+
except Exception as exc:
|
|
636
|
+
_raise_mapped(exc)
|
|
637
|
+
|
|
638
|
+
def get_issue_link_type(self, issue_link_type_id: str) -> dict[str, Any]:
|
|
639
|
+
"""Get issue link type by ID."""
|
|
640
|
+
try:
|
|
641
|
+
return self._client.get_issue_link_type(issue_link_type_id) # type: ignore[attr-defined]
|
|
642
|
+
except Exception as exc:
|
|
643
|
+
_raise_mapped(exc)
|
|
644
|
+
|
|
645
|
+
def delete_issue_link_type(self, issue_link_type_id: str) -> None:
|
|
646
|
+
"""Delete issue link type."""
|
|
647
|
+
try:
|
|
648
|
+
self._client.delete_issue_link_type(issue_link_type_id) # type: ignore[attr-defined]
|
|
649
|
+
except Exception as exc:
|
|
650
|
+
_raise_mapped(exc)
|
|
651
|
+
|
|
652
|
+
def update_issue_link_type(self, issue_link_type_id: str, data: dict[str, str]) -> dict[str, Any]:
|
|
653
|
+
"""Update issue link type."""
|
|
654
|
+
try:
|
|
655
|
+
return self._client.update_issue_link_type(issue_link_type_id, data) # type: ignore[attr-defined]
|
|
656
|
+
except Exception as exc:
|
|
657
|
+
_raise_mapped(exc)
|
|
658
|
+
|
|
659
|
+
# --- issue remote links ---
|
|
660
|
+
def get_issue_remote_links(self, issue_key: str) -> list[dict[str, Any]]:
|
|
661
|
+
"""List remote links for an issue."""
|
|
662
|
+
try:
|
|
663
|
+
result = self._client.get_issue_remote_links(issue_key) # type: ignore[attr-defined]
|
|
664
|
+
if isinstance(result, list):
|
|
665
|
+
return result
|
|
666
|
+
return result or []
|
|
667
|
+
except Exception as exc:
|
|
668
|
+
_raise_mapped(exc)
|
|
669
|
+
|
|
670
|
+
def create_or_update_issue_remote_link(self, issue_key: str, payload: dict[str, Any]) -> dict[str, Any]:
|
|
671
|
+
"""Create or update a remote link for an issue."""
|
|
672
|
+
try:
|
|
673
|
+
return self._client.create_or_update_issue_remote_links(issue_key, payload) # type: ignore[attr-defined]
|
|
674
|
+
except Exception as exc:
|
|
675
|
+
_raise_mapped(exc)
|
|
676
|
+
|
|
677
|
+
def get_issue_remote_link_by_id(self, issue_key: str, remote_link_id: str | int) -> dict[str, Any]:
|
|
678
|
+
"""Get a remote link by ID."""
|
|
679
|
+
try:
|
|
680
|
+
return self._client.get_issue_remote_link_by_id(issue_key, remote_link_id) # type: ignore[attr-defined]
|
|
681
|
+
except Exception as exc:
|
|
682
|
+
_raise_mapped(exc)
|
|
683
|
+
|
|
684
|
+
def update_issue_remote_link_by_id(
|
|
685
|
+
self,
|
|
686
|
+
issue_key: str,
|
|
687
|
+
remote_link_id: str | int,
|
|
688
|
+
payload: dict[str, Any],
|
|
689
|
+
) -> dict[str, Any]:
|
|
690
|
+
"""Update a remote link by ID."""
|
|
691
|
+
try:
|
|
692
|
+
return self._client.update_issue_remote_link_by_id(issue_key, remote_link_id, payload) # type: ignore[attr-defined]
|
|
693
|
+
except Exception as exc:
|
|
694
|
+
_raise_mapped(exc)
|
|
695
|
+
|
|
696
|
+
def delete_issue_remote_link_by_id(self, issue_key: str, remote_link_id: str | int) -> None:
|
|
697
|
+
"""Delete a remote link by ID."""
|
|
698
|
+
try:
|
|
699
|
+
self._client.delete_issue_remote_link_by_id(issue_key, remote_link_id) # type: ignore[attr-defined]
|
|
700
|
+
except Exception as exc:
|
|
701
|
+
_raise_mapped(exc)
|
|
702
|
+
|
|
703
|
+
# --- issue properties ---
|
|
704
|
+
def get_issue_property_keys(self, issue_key: str) -> dict[str, Any]:
|
|
705
|
+
"""Get issue property keys."""
|
|
706
|
+
try:
|
|
707
|
+
return self._client.get_issue_property_keys(issue_key) # type: ignore[attr-defined]
|
|
708
|
+
except Exception as exc:
|
|
709
|
+
_raise_mapped(exc)
|
|
710
|
+
|
|
711
|
+
def set_issue_property(self, issue_key: str, property_key: str, payload: dict[str, Any]) -> None:
|
|
712
|
+
"""Create or update an issue property."""
|
|
713
|
+
try:
|
|
714
|
+
self._client.set_issue_property(issue_key, property_key, payload) # type: ignore[attr-defined]
|
|
715
|
+
except Exception as exc:
|
|
716
|
+
_raise_mapped(exc)
|
|
717
|
+
|
|
718
|
+
def get_issue_property(self, issue_key: str, property_key: str) -> dict[str, Any]:
|
|
719
|
+
"""Get an issue property."""
|
|
720
|
+
try:
|
|
721
|
+
return self._client.get_issue_property(issue_key, property_key) # type: ignore[attr-defined]
|
|
722
|
+
except Exception as exc:
|
|
723
|
+
_raise_mapped(exc)
|
|
724
|
+
|
|
725
|
+
def delete_issue_property(self, issue_key: str, property_key: str) -> None:
|
|
726
|
+
"""Delete an issue property."""
|
|
727
|
+
try:
|
|
728
|
+
self._client.delete_issue_property(issue_key, property_key) # type: ignore[attr-defined]
|
|
729
|
+
except Exception as exc:
|
|
730
|
+
_raise_mapped(exc)
|
|
731
|
+
|
|
732
|
+
# --- issue watchers ---
|
|
733
|
+
def issue_get_watchers(self, issue_key: str) -> dict[str, Any]:
|
|
734
|
+
"""List watchers for an issue."""
|
|
735
|
+
try:
|
|
736
|
+
return self._client.issue_get_watchers(issue_key) # type: ignore[attr-defined]
|
|
737
|
+
except Exception as exc:
|
|
738
|
+
_raise_mapped(exc)
|
|
739
|
+
|
|
740
|
+
def issue_add_watcher(self, issue_key: str, username_or_account_id: str) -> None:
|
|
741
|
+
"""Add a watcher to an issue."""
|
|
742
|
+
try:
|
|
743
|
+
self._client.issue_add_watcher(issue_key, username_or_account_id) # type: ignore[attr-defined]
|
|
744
|
+
except Exception as exc:
|
|
745
|
+
_raise_mapped(exc)
|
|
746
|
+
|
|
747
|
+
def issue_delete_watcher(self, issue_key: str, username_or_account_id: str) -> None:
|
|
748
|
+
"""Remove a watcher from an issue."""
|
|
749
|
+
try:
|
|
750
|
+
self._client.issue_delete_watcher(issue_key, username_or_account_id) # type: ignore[attr-defined]
|
|
751
|
+
except Exception as exc:
|
|
752
|
+
_raise_mapped(exc)
|
|
753
|
+
|
|
754
|
+
# --- issue security schemes ---
|
|
755
|
+
def get_issue_security_schemes(self) -> list[dict[str, Any]]:
|
|
756
|
+
"""Get all security schemes."""
|
|
757
|
+
try:
|
|
758
|
+
return self._client.get_issue_security_schemes() # type: ignore[attr-defined]
|
|
759
|
+
except Exception as exc:
|
|
760
|
+
_raise_mapped(exc)
|
|
761
|
+
|
|
762
|
+
def get_issue_security_scheme(self, scheme_id: str, only_levels: bool = False) -> dict[str, Any]:
|
|
763
|
+
"""Get issue security scheme."""
|
|
764
|
+
try:
|
|
765
|
+
return self._client.get_issue_security_scheme(scheme_id, only_levels=only_levels) # type: ignore[attr-defined]
|
|
766
|
+
except Exception as exc:
|
|
767
|
+
_raise_mapped(exc)
|
|
768
|
+
|
|
769
|
+
# --- agile board operations ---
|
|
770
|
+
def get_agile_board_by_filter_id(self, filter_id: int) -> dict[str, Any]:
|
|
771
|
+
"""Get agile board by filter ID."""
|
|
772
|
+
try:
|
|
773
|
+
return self._client.get_agile_board_by_filter_id(filter_id) # type: ignore[attr-defined]
|
|
774
|
+
except Exception as exc:
|
|
775
|
+
_raise_mapped(exc)
|
|
776
|
+
|
|
777
|
+
def create_agile_board(
|
|
778
|
+
self, name: str, board_type: str, filter_id: int, location: dict[str, Any] | None = None
|
|
779
|
+
) -> dict[str, Any]:
|
|
780
|
+
"""Create a new agile board."""
|
|
781
|
+
try:
|
|
782
|
+
return self._client.create_agile_board(name, board_type, filter_id, location=location) # type: ignore[attr-defined]
|
|
783
|
+
except Exception as exc:
|
|
784
|
+
_raise_mapped(exc)
|
|
785
|
+
|
|
786
|
+
def get_all_agile_boards(
|
|
787
|
+
self,
|
|
788
|
+
board_name: str | None = None,
|
|
789
|
+
project_key: str | None = None,
|
|
790
|
+
board_type: str | None = None,
|
|
791
|
+
start: int = 0,
|
|
792
|
+
limit: int = 50,
|
|
793
|
+
) -> list[dict[str, Any]]:
|
|
794
|
+
"""Get all agile boards."""
|
|
795
|
+
try:
|
|
796
|
+
result = self._client.get_all_agile_boards(
|
|
797
|
+
board_name=board_name, project_key=project_key, board_type=board_type, start=start, limit=limit
|
|
798
|
+
) # type: ignore[attr-defined]
|
|
799
|
+
return result if isinstance(result, list) else list(result)
|
|
800
|
+
except Exception as exc:
|
|
801
|
+
_raise_mapped(exc)
|
|
802
|
+
|
|
803
|
+
def delete_agile_board(self, board_id: int) -> None:
|
|
804
|
+
"""Delete agile board by ID."""
|
|
805
|
+
try:
|
|
806
|
+
self._client.delete_agile_board(board_id) # type: ignore[attr-defined]
|
|
807
|
+
except Exception as exc:
|
|
808
|
+
_raise_mapped(exc)
|
|
809
|
+
|
|
810
|
+
def get_agile_board(self, board_id: int) -> dict[str, Any]:
|
|
811
|
+
"""Get agile board by ID."""
|
|
812
|
+
try:
|
|
813
|
+
return self._client.get_agile_board(board_id) # type: ignore[attr-defined]
|
|
814
|
+
except Exception as exc:
|
|
815
|
+
_raise_mapped(exc)
|
|
816
|
+
|
|
817
|
+
def get_issues_for_board(
|
|
818
|
+
self,
|
|
819
|
+
board_id: int,
|
|
820
|
+
jql: str | None = None,
|
|
821
|
+
fields: str = "*all",
|
|
822
|
+
start: int = 0,
|
|
823
|
+
limit: int | None = None,
|
|
824
|
+
expand: str | None = None,
|
|
825
|
+
) -> list[dict[str, Any]]:
|
|
826
|
+
"""Get issues for board."""
|
|
827
|
+
try:
|
|
828
|
+
result = self._client.get_issues_for_board(
|
|
829
|
+
board_id, jql=jql, fields=fields, start=start, limit=limit, expand=expand
|
|
830
|
+
) # type: ignore[attr-defined]
|
|
831
|
+
return result if isinstance(result, list) else list(result)
|
|
832
|
+
except Exception as exc:
|
|
833
|
+
_raise_mapped(exc)
|
|
834
|
+
|
|
835
|
+
def get_agile_board_configuration(self, board_id: int) -> dict[str, Any]:
|
|
836
|
+
"""Get agile board configuration by board ID."""
|
|
837
|
+
try:
|
|
838
|
+
return self._client.get_agile_board_configuration(board_id) # type: ignore[attr-defined]
|
|
839
|
+
except Exception as exc:
|
|
840
|
+
_raise_mapped(exc)
|
|
841
|
+
|
|
842
|
+
# component management is implemented above in "component operations"
|
|
843
|
+
|
|
844
|
+
# --- agile board properties ---
|
|
845
|
+
def get_agile_board_properties(self, board_id: int) -> list[dict[str, Any]]:
|
|
846
|
+
"""Get all board properties."""
|
|
847
|
+
try:
|
|
848
|
+
result = self._client.get_agile_board_properties(board_id) # type: ignore[attr-defined]
|
|
849
|
+
return result if isinstance(result, list) else list(result)
|
|
850
|
+
except Exception as exc:
|
|
851
|
+
_raise_mapped(exc)
|
|
852
|
+
|
|
853
|
+
def set_agile_board_property(self, board_id: int, property_key: str) -> None:
|
|
854
|
+
"""Set the value of the specified board's property."""
|
|
855
|
+
try:
|
|
856
|
+
self._client.set_agile_board_property(board_id, property_key) # type: ignore[attr-defined]
|
|
857
|
+
except Exception as exc:
|
|
858
|
+
_raise_mapped(exc)
|
|
859
|
+
|
|
860
|
+
def get_agile_board_property(self, board_id: int, property_key: str) -> dict[str, Any]:
|
|
861
|
+
"""Get agile board property."""
|
|
862
|
+
try:
|
|
863
|
+
return self._client.get_agile_board_property(board_id, property_key) # type: ignore[attr-defined]
|
|
864
|
+
except Exception as exc:
|
|
865
|
+
_raise_mapped(exc)
|
|
866
|
+
|
|
867
|
+
def delete_agile_board_property(self, board_id: int, property_key: str) -> None:
|
|
868
|
+
"""Delete agile board property."""
|
|
869
|
+
try:
|
|
870
|
+
self._client.delete_agile_board_property(board_id, property_key) # type: ignore[attr-defined]
|
|
871
|
+
except Exception as exc:
|
|
872
|
+
_raise_mapped(exc)
|
|
873
|
+
|
|
874
|
+
# --- agile board velocity ---
|
|
875
|
+
def get_agile_board_refined_velocity(self, board_id: int) -> dict[str, Any]:
|
|
876
|
+
"""Get agile board refined velocity."""
|
|
877
|
+
try:
|
|
878
|
+
return self._client.get_agile_board_refined_velocity(board_id) # type: ignore[attr-defined]
|
|
879
|
+
except Exception as exc:
|
|
880
|
+
_raise_mapped(exc)
|
|
881
|
+
|
|
882
|
+
def set_agile_board_refined_velocity(self, board_id: int, refined_velocity: dict[str, Any]) -> None:
|
|
883
|
+
"""Set agile board refined velocity."""
|
|
884
|
+
try:
|
|
885
|
+
self._client.set_agile_board_refined_velocity(board_id, refined_velocity) # type: ignore[attr-defined]
|
|
886
|
+
except Exception as exc:
|
|
887
|
+
_raise_mapped(exc)
|
|
888
|
+
|
|
889
|
+
# --- epic operations ---
|
|
890
|
+
def epic_issues(self, epic_key: str) -> list[dict[str, Any]]:
|
|
891
|
+
"""Get issues within an epic."""
|
|
892
|
+
try:
|
|
893
|
+
result = self._client.epic_issues(epic_key) # type: ignore[attr-defined]
|
|
894
|
+
return result if isinstance(result, list) else list(result)
|
|
895
|
+
except Exception as exc:
|
|
896
|
+
_raise_mapped(exc)
|
|
897
|
+
|
|
898
|
+
def get_epics(
|
|
899
|
+
self, board_id: int, done: bool = False, start: int = 0, limit: int = 50
|
|
900
|
+
) -> list[dict[str, Any]]:
|
|
901
|
+
"""Get all epics from board."""
|
|
902
|
+
try:
|
|
903
|
+
result = self._client.get_epics(board_id, done=done, start=start, limit=limit) # type: ignore[attr-defined]
|
|
904
|
+
return result if isinstance(result, list) else list(result)
|
|
905
|
+
except Exception as exc:
|
|
906
|
+
_raise_mapped(exc)
|
|
907
|
+
|
|
908
|
+
def get_issues_for_epic(
|
|
909
|
+
self,
|
|
910
|
+
board_id: int,
|
|
911
|
+
epic_id: int,
|
|
912
|
+
jql: str = "",
|
|
913
|
+
validate_query: str = "",
|
|
914
|
+
fields: str = "*all",
|
|
915
|
+
expand: str = "",
|
|
916
|
+
start: int = 0,
|
|
917
|
+
limit: int = 50,
|
|
918
|
+
) -> list[dict[str, Any]]:
|
|
919
|
+
"""Get all issues that belong to an epic on the board."""
|
|
920
|
+
try:
|
|
921
|
+
result = self._client.get_issues_for_epic(
|
|
922
|
+
board_id, epic_id, jql=jql, validate_query=validate_query, fields=fields, expand=expand, start=start, limit=limit
|
|
923
|
+
) # type: ignore[attr-defined]
|
|
924
|
+
return result if isinstance(result, list) else list(result)
|
|
925
|
+
except Exception as exc:
|
|
926
|
+
_raise_mapped(exc)
|
|
927
|
+
|
|
928
|
+
# --- sprint operations ---
|
|
929
|
+
def get_all_sprints_from_board(
|
|
930
|
+
self, board_id: int, state: str | None = None, start: int = 0, limit: int = 50
|
|
931
|
+
) -> list[dict[str, Any]]:
|
|
932
|
+
"""Get all sprints from board."""
|
|
933
|
+
try:
|
|
934
|
+
result = self._client.get_all_sprints_from_board(board_id, state=state, start=start, limit=limit) # type: ignore[attr-defined]
|
|
935
|
+
return result if isinstance(result, list) else list(result)
|
|
936
|
+
except Exception as exc:
|
|
937
|
+
_raise_mapped(exc)
|
|
938
|
+
|
|
939
|
+
def get_all_issues_for_sprint_in_board(
|
|
940
|
+
self, board_id: int, state: str | None = None, start: int = 0, limit: int = 50
|
|
941
|
+
) -> list[dict[str, Any]]:
|
|
942
|
+
"""Get all issues for sprint in board."""
|
|
943
|
+
try:
|
|
944
|
+
result = self._client.get_all_issues_for_sprint_in_board(board_id, state=state, start=start, limit=limit) # type: ignore[attr-defined]
|
|
945
|
+
return result if isinstance(result, list) else list(result)
|
|
946
|
+
except Exception as exc:
|
|
947
|
+
_raise_mapped(exc)
|
|
948
|
+
|
|
949
|
+
def get_all_versions_from_board(
|
|
950
|
+
self, board_id: int, released: str = "true", start: int = 0, limit: int = 50
|
|
951
|
+
) -> list[dict[str, Any]]:
|
|
952
|
+
"""Get all versions for sprint in board."""
|
|
953
|
+
try:
|
|
954
|
+
result = self._client.get_all_versions_from_board(board_id, released=released, start=start, limit=limit) # type: ignore[attr-defined]
|
|
955
|
+
return result if isinstance(result, list) else list(result)
|
|
956
|
+
except Exception as exc:
|
|
957
|
+
_raise_mapped(exc)
|
|
958
|
+
|
|
959
|
+
def create_sprint(
|
|
960
|
+
self,
|
|
961
|
+
sprint_name: str,
|
|
962
|
+
origin_board_id: int,
|
|
963
|
+
start_datetime: str | None = None,
|
|
964
|
+
end_datetime: str | None = None,
|
|
965
|
+
goal: str | None = None,
|
|
966
|
+
) -> dict[str, Any]:
|
|
967
|
+
"""Create sprint."""
|
|
968
|
+
try:
|
|
969
|
+
return self._client.create_sprint(sprint_name, origin_board_id, start_datetime, end_datetime, goal) # type: ignore[attr-defined]
|
|
970
|
+
except Exception as exc:
|
|
971
|
+
_raise_mapped(exc)
|
|
972
|
+
|
|
973
|
+
def rename_sprint(
|
|
974
|
+
self, sprint_id: int, name: str | None = None, start_date: str | None = None, end_date: str | None = None
|
|
975
|
+
) -> dict[str, Any]:
|
|
976
|
+
"""Rename sprint."""
|
|
977
|
+
try:
|
|
978
|
+
return self._client.rename_sprint(sprint_id, name, start_date, end_date) # type: ignore[attr-defined]
|
|
979
|
+
except Exception as exc:
|
|
980
|
+
_raise_mapped(exc)
|
|
981
|
+
|
|
982
|
+
def add_issues_to_sprint(self, sprint_id: int, issues_list: list[str]) -> None:
|
|
983
|
+
"""Add/Move issues to sprint."""
|
|
984
|
+
try:
|
|
985
|
+
self._client.add_issues_to_sprint(sprint_id, issues_list) # type: ignore[attr-defined]
|
|
986
|
+
except Exception as exc:
|
|
987
|
+
_raise_mapped(exc)
|
|
988
|
+
|
|
989
|
+
# --- backlog operations ---
|
|
990
|
+
def move_issues_to_backlog(self, issue_keys: list[str]) -> None:
|
|
991
|
+
"""Move issues to backlog."""
|
|
992
|
+
try:
|
|
993
|
+
self._client.move_issues_to_backlog(issue_keys) # type: ignore[attr-defined]
|
|
994
|
+
except Exception as exc:
|
|
995
|
+
_raise_mapped(exc)
|
|
996
|
+
|
|
997
|
+
def add_issues_to_backlog(self, issue_keys: list[str]) -> None:
|
|
998
|
+
"""Add issues to backlog."""
|
|
999
|
+
try:
|
|
1000
|
+
self._client.add_issues_to_backlog(issue_keys) # type: ignore[attr-defined]
|
|
1001
|
+
except Exception as exc:
|
|
1002
|
+
_raise_mapped(exc)
|
|
1003
|
+
|
|
1004
|
+
# --- worklog operations ---
|
|
1005
|
+
def get_worklogs(self, issue_key: str) -> dict[str, Any]:
|
|
1006
|
+
"""Get worklogs for an issue."""
|
|
1007
|
+
try:
|
|
1008
|
+
return self._client.issue_get_worklog(issue_key) # type: ignore[attr-defined]
|
|
1009
|
+
except Exception as exc:
|
|
1010
|
+
_raise_mapped(exc)
|
|
1011
|
+
|
|
1012
|
+
def issue_add_worklog(
|
|
1013
|
+
self,
|
|
1014
|
+
issue_key: str,
|
|
1015
|
+
time_spent: str,
|
|
1016
|
+
comment: str | None = None,
|
|
1017
|
+
started: str | None = None,
|
|
1018
|
+
time_sec: int | None = None,
|
|
1019
|
+
) -> dict[str, Any]:
|
|
1020
|
+
"""Add worklog entry to an issue.
|
|
1021
|
+
|
|
1022
|
+
Args:
|
|
1023
|
+
issue_key: Issue key (e.g., 'PROJ-123')
|
|
1024
|
+
time_spent: Time spent string (e.g., '2h 30m')
|
|
1025
|
+
comment: Optional comment
|
|
1026
|
+
started: Optional start datetime (ISO format)
|
|
1027
|
+
time_sec: Optional time in seconds (alternative to time_spent)
|
|
1028
|
+
"""
|
|
1029
|
+
try:
|
|
1030
|
+
if started and time_sec is not None:
|
|
1031
|
+
# Use simple worklog method if we have started and time_sec
|
|
1032
|
+
return self._client.issue_worklog(issue_key, started, time_sec, comment) # type: ignore[attr-defined]
|
|
1033
|
+
else:
|
|
1034
|
+
# Use JSON worklog method for more flexibility
|
|
1035
|
+
worklog: dict[str, Any] = {"timeSpent": time_spent}
|
|
1036
|
+
if comment:
|
|
1037
|
+
worklog["comment"] = comment
|
|
1038
|
+
if started:
|
|
1039
|
+
worklog["started"] = started
|
|
1040
|
+
return self._client.issue_add_json_worklog(issue_key, worklog) # type: ignore[attr-defined]
|
|
1041
|
+
except Exception as exc:
|
|
1042
|
+
_raise_mapped(exc)
|
|
1043
|
+
|
|
1044
|
+
def get_updated_worklogs(self, since: str, expand: str | None = None) -> dict[str, Any]:
|
|
1045
|
+
"""Get worklogs updated since timestamp.
|
|
1046
|
+
|
|
1047
|
+
Args:
|
|
1048
|
+
since: Timestamp in format 'YYYY-MM-DD HH:mm' or ISO format
|
|
1049
|
+
expand: Optional expand parameter
|
|
1050
|
+
"""
|
|
1051
|
+
try:
|
|
1052
|
+
return self._client.get_updated_worklogs(since, expand=expand) # type: ignore[attr-defined]
|
|
1053
|
+
except Exception as exc:
|
|
1054
|
+
_raise_mapped(exc)
|
|
1055
|
+
|
|
1056
|
+
def get_deleted_worklogs(self, since: str) -> dict[str, Any]:
|
|
1057
|
+
"""Get deleted worklogs since timestamp.
|
|
1058
|
+
|
|
1059
|
+
Args:
|
|
1060
|
+
since: Timestamp in format 'YYYY-MM-DD HH:mm' or ISO format
|
|
1061
|
+
"""
|
|
1062
|
+
try:
|
|
1063
|
+
return self._client.get_deleted_worklogs(since) # type: ignore[attr-defined]
|
|
1064
|
+
except Exception as exc:
|
|
1065
|
+
_raise_mapped(exc)
|
|
1066
|
+
|
|
1067
|
+
# --- transitions and changelog operations ---
|
|
1068
|
+
def get_issue_transitions(self, issue_key: str) -> list[dict[str, Any]]:
|
|
1069
|
+
"""Get available transitions for an issue."""
|
|
1070
|
+
try:
|
|
1071
|
+
return self._client.get_issue_transitions(issue_key) # type: ignore[attr-defined]
|
|
1072
|
+
except Exception as exc:
|
|
1073
|
+
_raise_mapped(exc)
|
|
1074
|
+
|
|
1075
|
+
def get_issue_changelog(
|
|
1076
|
+
self, issue_key: str, start: int | None = None, limit: int | None = None
|
|
1077
|
+
) -> dict[str, Any]:
|
|
1078
|
+
"""Get complete change history for an issue.
|
|
1079
|
+
|
|
1080
|
+
Args:
|
|
1081
|
+
issue_key: Issue key (e.g., 'PROJ-123')
|
|
1082
|
+
start: Optional start index for pagination
|
|
1083
|
+
limit: Optional limit for pagination
|
|
1084
|
+
"""
|
|
1085
|
+
try:
|
|
1086
|
+
return self._client.get_issue_changelog(issue_key, start=start, limit=limit) # type: ignore[attr-defined]
|
|
1087
|
+
except Exception as exc:
|
|
1088
|
+
_raise_mapped(exc)
|
|
1089
|
+
|
|
1090
|
+
def get_issue_status_changelog(self, issue_key: str) -> dict[str, Any]:
|
|
1091
|
+
"""Get status change history for an issue.
|
|
1092
|
+
|
|
1093
|
+
Args:
|
|
1094
|
+
issue_key: Issue key (e.g., 'PROJ-123')
|
|
1095
|
+
"""
|
|
1096
|
+
try:
|
|
1097
|
+
return self._client.get_issue_status_changelog(issue_key) # type: ignore[attr-defined]
|
|
1098
|
+
except Exception as exc:
|
|
1099
|
+
_raise_mapped(exc)
|
|
1100
|
+
|
|
1101
|
+
# --- dashboard operations ---
|
|
1102
|
+
def get_dashboard(self, dashboard_id: str | int) -> dict[str, Any]:
|
|
1103
|
+
"""Get dashboard by ID.
|
|
1104
|
+
|
|
1105
|
+
Args:
|
|
1106
|
+
dashboard_id: Dashboard ID (string or integer)
|
|
1107
|
+
"""
|
|
1108
|
+
try:
|
|
1109
|
+
result = self._client.get_dashboard(dashboard_id) # type: ignore[attr-defined]
|
|
1110
|
+
if not result:
|
|
1111
|
+
raise JiraNotFound(f"Dashboard not found: {dashboard_id}")
|
|
1112
|
+
return result
|
|
1113
|
+
except Exception as exc:
|
|
1114
|
+
_raise_mapped(exc)
|
|
1115
|
+
|
|
1116
|
+
def get_dashboards(
|
|
1117
|
+
self, filter: str = "", start: int = 0, limit: int = 10
|
|
1118
|
+
) -> dict[str, Any]:
|
|
1119
|
+
"""List dashboards with optional filter.
|
|
1120
|
+
|
|
1121
|
+
Args:
|
|
1122
|
+
filter: Optional filter string
|
|
1123
|
+
start: Start index for pagination
|
|
1124
|
+
limit: Maximum number of results
|
|
1125
|
+
"""
|
|
1126
|
+
try:
|
|
1127
|
+
result = self._client.get_dashboards(filter=filter, start=start, limit=limit) # type: ignore[attr-defined]
|
|
1128
|
+
return result if result else {}
|
|
1129
|
+
except Exception as exc:
|
|
1130
|
+
_raise_mapped(exc)
|
|
1131
|
+
|
|
1132
|
+
# --- reindex operations ---
|
|
1133
|
+
def reindex(self) -> dict[str, Any]:
|
|
1134
|
+
"""Trigger reindex."""
|
|
1135
|
+
try:
|
|
1136
|
+
return self._client.reindex() # type: ignore[attr-defined]
|
|
1137
|
+
except Exception as exc:
|
|
1138
|
+
_raise_mapped(exc)
|
|
1139
|
+
|
|
1140
|
+
def reindex_status(self) -> dict[str, Any]:
|
|
1141
|
+
"""Get reindex status."""
|
|
1142
|
+
try:
|
|
1143
|
+
return self._client.reindex_status() # type: ignore[attr-defined]
|
|
1144
|
+
except Exception as exc:
|
|
1145
|
+
_raise_mapped(exc)
|
|
1146
|
+
|
|
1147
|
+
def reindex_with_type(self, reindex_type: str) -> dict[str, Any]:
|
|
1148
|
+
"""Reindex with type."""
|
|
1149
|
+
try:
|
|
1150
|
+
return self._client.reindex_with_type(reindex_type) # type: ignore[attr-defined]
|
|
1151
|
+
except Exception as exc:
|
|
1152
|
+
_raise_mapped(exc)
|
|
1153
|
+
|
|
1154
|
+
# --- filter operations ---
|
|
1155
|
+
def get_filters(self, owner: str | None = None) -> list[dict[str, Any]]:
|
|
1156
|
+
"""Get list of filters, optionally filtered by owner.
|
|
1157
|
+
|
|
1158
|
+
Args:
|
|
1159
|
+
owner: Optional username to filter by owner
|
|
1160
|
+
"""
|
|
1161
|
+
try:
|
|
1162
|
+
# SDK doesn't have get_filters, use REST API directly
|
|
1163
|
+
# Endpoint: /rest/api/2/filter/search
|
|
1164
|
+
params: dict[str, Any] = {}
|
|
1165
|
+
if owner:
|
|
1166
|
+
params["username"] = owner
|
|
1167
|
+
|
|
1168
|
+
# Use SDK's get method with resource URL
|
|
1169
|
+
base_url = self._client.resource_url("filter") # type: ignore[attr-defined]
|
|
1170
|
+
url = f"{base_url}/search"
|
|
1171
|
+
result = self._client.get(url, params=params) # type: ignore[attr-defined]
|
|
1172
|
+
return result.get("values", []) if isinstance(result, dict) else (result if isinstance(result, list) else [])
|
|
1173
|
+
except Exception as exc:
|
|
1174
|
+
_raise_mapped(exc)
|
|
1175
|
+
|
|
1176
|
+
def get_filter(self, filter_id: int) -> dict[str, Any]:
|
|
1177
|
+
"""Get filter by ID.
|
|
1178
|
+
|
|
1179
|
+
Args:
|
|
1180
|
+
filter_id: Filter ID
|
|
1181
|
+
"""
|
|
1182
|
+
try:
|
|
1183
|
+
result = self._client.get_filter(filter_id) # type: ignore[attr-defined]
|
|
1184
|
+
if not result:
|
|
1185
|
+
raise JiraNotFound(f"Filter not found: {filter_id}")
|
|
1186
|
+
return result
|
|
1187
|
+
except Exception as exc:
|
|
1188
|
+
_raise_mapped(exc)
|
|
1189
|
+
|
|
1190
|
+
def create_filter(
|
|
1191
|
+
self, name: str, jql: str, description: str | None = None, favourite: bool = False
|
|
1192
|
+
) -> dict[str, Any]:
|
|
1193
|
+
"""Create a new filter.
|
|
1194
|
+
|
|
1195
|
+
Args:
|
|
1196
|
+
name: Filter name
|
|
1197
|
+
jql: JQL query string
|
|
1198
|
+
description: Optional description
|
|
1199
|
+
favourite: Whether to mark as favourite (default: False)
|
|
1200
|
+
"""
|
|
1201
|
+
try:
|
|
1202
|
+
return self._client.create_filter(name=name, jql=jql, description=description, favourite=favourite) # type: ignore[attr-defined]
|
|
1203
|
+
except Exception as exc:
|
|
1204
|
+
_raise_mapped(exc)
|
|
1205
|
+
|
|
1206
|
+
def update_filter(
|
|
1207
|
+
self,
|
|
1208
|
+
filter_id: int,
|
|
1209
|
+
name: str | None = None,
|
|
1210
|
+
jql: str | None = None,
|
|
1211
|
+
description: str | None = None,
|
|
1212
|
+
favourite: bool | None = None,
|
|
1213
|
+
) -> dict[str, Any]:
|
|
1214
|
+
"""Update an existing filter.
|
|
1215
|
+
|
|
1216
|
+
Args:
|
|
1217
|
+
filter_id: Filter ID
|
|
1218
|
+
name: Optional new name
|
|
1219
|
+
jql: Optional new JQL query (required if not updating other fields)
|
|
1220
|
+
description: Optional new description
|
|
1221
|
+
favourite: Optional favourite status
|
|
1222
|
+
"""
|
|
1223
|
+
try:
|
|
1224
|
+
# SDK's update_filter requires jql, but we allow partial updates
|
|
1225
|
+
# If jql is not provided, we need to get the current filter first
|
|
1226
|
+
if jql is None:
|
|
1227
|
+
# Get current filter to preserve existing JQL
|
|
1228
|
+
current = self.get_filter(filter_id)
|
|
1229
|
+
jql = current.get("jql", "")
|
|
1230
|
+
|
|
1231
|
+
kwargs: dict[str, Any] = {}
|
|
1232
|
+
if name is not None:
|
|
1233
|
+
kwargs["name"] = name
|
|
1234
|
+
if description is not None:
|
|
1235
|
+
kwargs["description"] = description
|
|
1236
|
+
if favourite is not None:
|
|
1237
|
+
kwargs["favourite"] = favourite
|
|
1238
|
+
|
|
1239
|
+
return self._client.update_filter(filter_id, jql=jql, **kwargs) # type: ignore[attr-defined]
|
|
1240
|
+
except Exception as exc:
|
|
1241
|
+
_raise_mapped(exc)
|
|
1242
|
+
|
|
1243
|
+
def delete_filter(self, filter_id: int) -> None:
|
|
1244
|
+
"""Delete a filter.
|
|
1245
|
+
|
|
1246
|
+
Args:
|
|
1247
|
+
filter_id: Filter ID
|
|
1248
|
+
"""
|
|
1249
|
+
try:
|
|
1250
|
+
self._client.delete_filter(filter_id) # type: ignore[attr-defined]
|
|
1251
|
+
except Exception as exc:
|
|
1252
|
+
_raise_mapped(exc)
|
|
1253
|
+
|
|
1254
|
+
# --- advanced search operations ---
|
|
1255
|
+
def search_issues_advanced(
|
|
1256
|
+
self,
|
|
1257
|
+
jql: str,
|
|
1258
|
+
*,
|
|
1259
|
+
start: int = 0,
|
|
1260
|
+
limit: int = 50,
|
|
1261
|
+
fields: Iterable[str] | None = None,
|
|
1262
|
+
) -> dict[str, Any]:
|
|
1263
|
+
"""Advanced JQL search with pagination support.
|
|
1264
|
+
|
|
1265
|
+
Args:
|
|
1266
|
+
jql: JQL query string
|
|
1267
|
+
start: Start index for pagination (default: 0)
|
|
1268
|
+
limit: Maximum number of results (default: 50)
|
|
1269
|
+
fields: Optional list of fields to return (default: *all)
|
|
1270
|
+
"""
|
|
1271
|
+
try:
|
|
1272
|
+
fields_str = ",".join(fields) if fields else "*all"
|
|
1273
|
+
return self._client.jql(jql, fields=fields_str, start=start, limit=limit) # type: ignore[attr-defined]
|
|
1274
|
+
except Exception as exc:
|
|
1275
|
+
_raise_mapped(exc)
|
|
1276
|
+
|
|
1277
|
+
def search_issues_by_filter(
|
|
1278
|
+
self,
|
|
1279
|
+
filter_id: int,
|
|
1280
|
+
*,
|
|
1281
|
+
start: int = 0,
|
|
1282
|
+
limit: int = 50,
|
|
1283
|
+
fields: Iterable[str] | None = None,
|
|
1284
|
+
) -> dict[str, Any]:
|
|
1285
|
+
"""Search issues using a saved filter.
|
|
1286
|
+
|
|
1287
|
+
Args:
|
|
1288
|
+
filter_id: Filter ID
|
|
1289
|
+
start: Start index for pagination (default: 0)
|
|
1290
|
+
limit: Maximum number of results (default: 50)
|
|
1291
|
+
fields: Optional list of fields to return (default: *all)
|
|
1292
|
+
"""
|
|
1293
|
+
try:
|
|
1294
|
+
# Get the filter to extract its JQL
|
|
1295
|
+
filter_data = self.get_filter(filter_id)
|
|
1296
|
+
jql = filter_data.get("jql", "")
|
|
1297
|
+
if not jql:
|
|
1298
|
+
raise JiraAdapterError(f"Filter {filter_id} does not have a JQL query")
|
|
1299
|
+
|
|
1300
|
+
# Use the filter's JQL for search
|
|
1301
|
+
return self.search_issues_advanced(jql, start=start, limit=limit, fields=fields)
|
|
1302
|
+
except Exception as exc:
|
|
1303
|
+
_raise_mapped(exc)
|
|
1304
|
+
|
|
1305
|
+
|
|
1306
|
+
def _raise_mapped(exc: Exception) -> None:
|
|
1307
|
+
text = str(exc).lower()
|
|
1308
|
+
if "401" in text or "403" in text or "unauthorized" in text:
|
|
1309
|
+
raise JiraAuthError(str(exc)) from exc
|
|
1310
|
+
if "404" in text or "not found" in text:
|
|
1311
|
+
raise JiraNotFound(str(exc)) from exc
|
|
1312
|
+
if "429" in text or "rate limit" in text:
|
|
1313
|
+
raise JiraRateLimited(str(exc)) from exc
|
|
1314
|
+
if "409" in text or "conflict" in text:
|
|
1315
|
+
raise JiraConflictError(str(exc)) from exc
|
|
1316
|
+
if "500" in text or "server error" in text:
|
|
1317
|
+
raise JiraResponseError(str(exc)) from exc
|
|
1318
|
+
if "connection" in text or "network" in text or "timeout" in text:
|
|
1319
|
+
raise JiraTransportError(str(exc)) from exc
|
|
1320
|
+
raise JiraAdapterError(str(exc)) from exc
|