Jira Workitem Attachのロゴ

Jira Workitem Attach

組織
opendatahub-io
jira-workitem-attach

Jiraチケットにファイルを添付します。ファイルの存在を確認し、Jira API経由でアップロードします。ユーザーがチケットにファイルを添付したい場合に使用します。

概要

公開者opendatahub-io
リポジトリai-helpers
スキル名jira-workitem-attach
スター
39
フォーク
76
同梱ファイル
1
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 1個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    opendatahub-ioがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Jira Workitem Attach」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-jira/skills/jira-workitem-attach
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/opendatahub-io/ai-helpers.git /tmp/ai-helpers
mkdir -p .claude/skills
cp -r /tmp/ai-helpers/plugins/odh-jira/skills/jira-workitem-attach .claude/skills/jira-workitem-attach
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでJira Workitem Attachを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にJira Workitem Attachを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Jira Workitem Attachは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Jira Workitem Attach

Upload file attachments to Jira tickets using the Jira REST API (since acli does not support attachment uploads).

Prerequisites

  • acli must be installed and authenticated (acli jira auth) to verify the upload
  • Python 3.10+ and uv must be installed
  • JIRA_API_TOKEN environment variable must be set with a valid API token
  • JIRA_EMAIL environment variable must be set with the email address associated with your Atlassian account

Security Note: The JIRA_API_TOKEN is sensitive and should be kept secure:

  • Never log or echo the token value
  • Avoid running debug commands that print environment variables
  • The upload script handles the token securely via HTTPS
  • Do not share logs or command output that may contain the token

Implementation

Step 1: Verify ACLi Setup

Before proceeding, verify that acli is installed and authenticated by invoking the acli-setup-check skill:

text
/acli-setup-check

If the setup check fails, stop execution and guide the user to fix the issue.

Step 2: Verify Environment Variables

Check that the required environment variables are set:

bash
if [[ -z "$JIRA_API_TOKEN" || -z "$JIRA_EMAIL" ]]; then
  echo "Error: JIRA_API_TOKEN and JIRA_EMAIL environment variables must be set"
  exit 1
fi

If either variable is missing, inform the user:

text
JIRA_API_TOKEN and JIRA_EMAIL environment variables are required for uploading attachments.

To set them:
  export JIRA_EMAIL="your-email@redhat.com"
  export JIRA_API_TOKEN="your-api-token"

Get your API token from:
  https://id.atlassian.com/manage-profile/security/api-tokens

Note: The Python upload script will also validate these variables, but checking early provides better user experience.

Step 3: Determine Ticket Key and File Path

  1. Ticket Key:

    • If provided by user, use it
    • Otherwise, search conversation history for ticket references matching the pattern [A-Z]+-\d+
    • If not found, ask: "Which ticket should I attach the file to?"
  2. File Path:

    • If user provides a file path, validate it exists
    • If user mentions a file by name, search for it in the current directory
    • If unclear, ask: "Which file should I attach?"
  3. Validate File Path Security:

    Before proceeding to Step 4, validate the FILE_PATH for security:

    bash
    # Resolve to absolute path and check it exists
    FILE_PATH="<user-provided-path>"
    REAL_PATH=$(realpath -e "$FILE_PATH" 2>/dev/null)
    if [[ $? -ne 0 ]]; then
      echo "Error: File does not exist or is not accessible: $FILE_PATH"
      exit 1
    fi
    
    # Check if file is readable
    if [[ ! -r "$REAL_PATH" ]]; then
      echo "Error: File is not readable: $FILE_PATH"
      exit 1
    fi
    
    # Reject parent-traversal patterns in original path
    if [[ "$FILE_PATH" == *".."* ]]; then
      echo "Error: Parent directory traversal (..) not allowed in file path"
      exit 1
    fi
    
    # Restrict to allowed directories: current working directory or /tmp
    CURRENT_DIR=$(pwd)
    if [[ "$REAL_PATH" != "$CURRENT_DIR"/* ]] && [[ "$REAL_PATH" != /tmp/* ]]; then
      echo "Error: File must be in current directory or /tmp for security"
      echo "  File location: $REAL_PATH"
      echo "  Allowed: $CURRENT_DIR/* or /tmp/*"
      exit 1
    fi
    
    # Check for symlinks pointing outside allowed directories
    if [[ -L "$FILE_PATH" ]]; then
      echo "Error: Symlinks not allowed for security reasons"
      exit 1
    fi

    If any validation fails, surface the error to the user and abort before calling upload_attachment.py.

Step 4: Upload Attachment

Since acli does not support attachment uploads, use the upload script located at scripts/upload_attachment.py relative to the jira-workitem-attach skill directory.

Resolve the skill directory path and execute the script directly (not via python or bash) to invoke uv via the shebang:

bash
# Resolve skill directory path (adjust based on runtime context)
# Option 1: If skill directory is known via environment or context
SKILL_DIR="<path-to-helpers>/helpers/skills/jira-workitem-attach"

# Option 2: Compute relative to repository root if available
# SKILL_DIR="${REPO_ROOT}/helpers/skills/jira-workitem-attach"

# Option 3: Use current directory if already in skill directory
# SKILL_DIR="$(pwd)"

# Execute the upload script with resolved path
"$SKILL_DIR/scripts/upload_attachment.py" "$TICKET_KEY" "$FILE_PATH"

Note: The skill directory path resolution method depends on how the runtime provides context. Use whichever approach is available (environment variables, repository-root relative paths, or explicit path configuration).

The script will:

  • Verify environment variables (JIRA_API_TOKEN, JIRA_EMAIL) are set
  • Validate the file exists, is readable, and check its size
  • Verify the ticket exists and is accessible
  • Upload the file as an attachment to the ticket
  • Display success message with attachment details
  • Exit with non-zero status on failure

Step 5: Verify Upload Success

After the upload script completes, verify the attachment was successfully added using acli:

bash
acli jira workitem attachment list --key <TICKET-KEY>

This command will display all attachments on the ticket, including the newly uploaded file. Confirm the file appears in the list with the correct name and size.

Step 6: Report Success

After successfully uploading and verifying the attachment, report to the user:

text
✓ Attachment uploaded to <TICKET-KEY>
  File: <filename> (<size>)
  View: https://redhat.atlassian.net/browse/<TICKET-KEY>

If the attachment doesn't appear in the list, report the issue and check the upload script output for errors

Error Handling

  • acli not found: Delegate to acli-setup-check skill
  • Authentication failure: Delegate to acli-setup-check skill
  • All upload errors: The Python script handles and reports:
    • Missing environment variables (JIRA_API_TOKEN, JIRA_EMAIL)
    • File not found or not readable
    • File too large (warns if > 10MB)
    • Invalid ticket key
    • Permission denied
    • Network errors

Limitations

  • acli does not support uploading attachments, so this skill uses the Jira REST API directly
  • Requires JIRA_API_TOKEN and JIRA_EMAIL environment variables (in addition to acli auth)
  • File size limits depend on Jira instance configuration (typically 10MB)
  • For very large files, use a file sharing service and post a link instead

Examples

Attach a File

text
User: Attach error.log to RHAI-1234
Assistant: [Verifies file exists, uploads via API]
Attachment uploaded to RHAI-1234
File: error.log (15.2 KB)
View: https://redhat.atlassian.net/browse/RHAI-1234

Attach Chat Log

text
User: Attach the conversation log to RHAI-5678
Assistant: [Exports conversation, uploads to ticket]
Attachment uploaded to RHAI-5678
File: conversation-2024-03-20.md (42.1 KB)
View: https://redhat.atlassian.net/browse/RHAI-5678

Large File Warning

text
User: Attach large-dataset.csv to RHAI-910
Assistant: Warning: large-dataset.csv is 15.3 MB, which exceeds the typical 10MB Jira limit.
The upload may fail. Would you like to proceed anyway?
User: Yes
Assistant: [Attempts upload]
✗ Upload failed: Request Entity Too Large (413)

Consider compressing the file or using a file sharing service instead.

List Attachments After Upload

text
User: Attach screenshot.png to RHAI-1234
Assistant: [Uploads file]
Attachment uploaded to RHAI-1234
File: screenshot.png (234 KB)

Current attachments on RHAI-1234:
- screenshot.png (234 KB) - uploaded just now
- error.log (15.2 KB) - uploaded 2024-03-19
- build.log (8.1 KB) - uploaded 2024-03-18

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Jira Workitem Attach」では何ができますか?

Jiraチケットにファイルを添付します。ファイルの存在を確認し、Jira API経由でアップロードします。ユーザーがチケットにファイルを添付したい場合に使用します。

TypingMindでJira Workitem Attachを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Jira Workitem Attachはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにJira Workitem Attachをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-jira/skills/jira-workitem-attachを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Jira Workitem Attachを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Jira Workitem Attachで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもJira Workitem Attachを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Jira Workitem Attach」は無料ですか?

はい。opendatahub-ioがApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇