Compare JSM automation rules and workflows between Jira Cloud environments
Project description
jsm-compare
Jira Service Management (JSM) の自動化ルールをサンドボックスと本番環境で比較するCLIツール。
環境間のルール設定ドリフトを検出し、本番デプロイ前の差分チェックを自動化します。
インストール
# インストール不要で即実行(uvx)
uvx jsm-compare rules --domain my-project --user me@example.com
# グローバルインストール
uv tool install jsm-compare
# pip
pip install jsm-compare
使い方
基本
# 環境変数で認証情報を設定
export JIRA_USER="me@example.com"
export JIRA_API_TOKEN="ATATT3x..."
# ドメイン指定(推奨)- sandbox/本番を自動展開
jsm-compare rules --domain my-project
# セクション指定
jsm-compare rules --domain my-project --section rules-overview
jsm-compare rules --domain my-project --section triggers
jsm-compare rules --domain my-project --section components
# フルホスト名指定(カスタムホスト名の場合)
jsm-compare rules --source my-project-sandbox.atlassian.net --target my-project.atlassian.net
--domain my-project は --source my-project-sandbox.atlassian.net --target my-project.atlassian.net に展開されます。
オプション
# ルール名でフィルタ
jsm-compare rules --domain my-project --filter '[MyPrefix]'
# Webhook URL等のセンシティブ値をマスク
jsm-compare rules --domain my-project --mask
# デバッグ用: 正規化後のJSONを表示
jsm-compare rules --domain my-project --raw
認証
Jira Cloud APIトークンが必要です。 Atlassian API トークンの管理 から取得できます。
Automation REST APIにアクセスするには Jira管理者権限が必要です。
| パラメータ | 環境変数 | 説明 |
|---|---|---|
--user |
JIRA_USER |
Jira Cloud のメールアドレス |
--token |
JIRA_API_TOKEN |
Jira API トークン |
比較セクション
| セクション | 比較内容 |
|---|---|
rules-overview |
ルール名、state (ENABLED/DISABLED)、description |
triggers |
トリガーtype、スケジュール設定、JQL条件 |
components |
条件・アクション設定(環境固有のID/ARI自動除外) |
正規化
環境固有で比較不要なフィールドは自動的に除外されます。
除外フィールド
ルールレベル: id, clientKey, authorAccountId, actor, created, updated, ruleScope, labels, tags
コンポーネントレベル: id, parentId, conditionParentId, connectionId, checksum, schemaVersion
トリガー: eventFilters (ARI形式のプロジェクト参照)
出力例
JSM Automation Rules Comparison
Source: my-project-sandbox.atlassian.net
Target: my-project.atlassian.net
Filter: [MyPrefix]
────── Section 1: Rules Overview ──────
[INFO] Only in source:
[MyPrefix]Incident Creation Rule 20260324 [DISABLED]
[MATCH] Recovery Notification 20260401
[DIFF] Customer Comment Notification 20260401
- "description": "... Webhook URL管理者 : Admin User"
+ "description": "... 管理先Slack API : https://api.slack.com/..."
────── Section 2: Triggers ──────
[MATCH] Recovery Notification 20260401 [trigger]
[MATCH] Customer Comment Notification 20260401 [trigger]
────── Section 3: Components ──────
[DIFF] Incident Creation Rule 20260330 [components]
- "value": "{{issue.customfield_10557}}"
+ "value": "{{issue.customfield_10356}}"
Differences found. Review the output above.
終了コード
| コード | 意味 |
|---|---|
| 0 | 全セクション一致 |
| 1 | 差分あり |
| 2 | エラー(認証失敗、API接続エラーなど) |
動作要件
- Python 3.10+
- Jira Cloud 環境
- Jira管理者権限(Automation REST API アクセスに必要)
ライセンス
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jsm_compare-0.1.1.tar.gz.
File metadata
- Download URL: jsm_compare-0.1.1.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b0b4f3ff7a1bf3ae9de5c563d189b1714dde4512d60323075a4bc50b5aa4897
|
|
| MD5 |
7e68ceebaa14af305de796b4ebd0230b
|
|
| BLAKE2b-256 |
381f7b79ad007985c8b84555b13b2070ad85436aa65a94263d6129bc9e7eafd5
|
File details
Details for the file jsm_compare-0.1.1-py3-none-any.whl.
File metadata
- Download URL: jsm_compare-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88d97d12509ffaec7f3bf88cb22ab8f12d91727b585040dca11005fba21184ae
|
|
| MD5 |
4147e1ac796c87c90474f213eccb7aa8
|
|
| BLAKE2b-256 |
c67f3a921564c11d25aad39e88fabfd613094fbef14aa9c5ab32be129084081a
|