Logo di Jira Workitem Attach

Jira Workitem Attach

Organizzazione
opendatahub-io
jira-workitem-attach

Carica allegati sui ticket Jira. Verifica che il file esista e lo carica tramite Jira API. Usala quando l’utente vuole allegare file ai ticket.

Panoramica

Pubblicato daopendatahub-io
Repositoryai-helpers
Nome della skilljira-workitem-attach
Stelle
39
Fork
76
File inclusi
1
LicenzaApache-2.0
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 1

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da opendatahub-io su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Jira Workitem Attach in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-jira/skills/jira-workitem-attach
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Jira Workitem Attach in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Jira Workitem Attach non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Jira Workitem Attach non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

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

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Jira Workitem Attach?

Carica allegati sui ticket Jira. Verifica che il file esista e lo carica tramite Jira API. Usala quando l’utente vuole allegare file ai ticket.

Perché usare Jira Workitem Attach su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Jira Workitem Attach è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Jira Workitem Attach in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-jira/skills/jira-workitem-attach. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Jira Workitem Attach?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Jira Workitem Attach?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Jira Workitem Attach: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Jira Workitem Attach è gratuita?

Sì. È pubblicata su GitHub da opendatahub-io con licenza Apache-2.0. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇