Logotipo de Jira Workitem Attach

Jira Workitem Attach

Organización
opendatahub-io
jira-workitem-attach

Sube archivos adjuntos a tickets de Jira. Comprueba que el archivo existe y lo sube mediante la API de Jira. Úsala cuando el usuario quiera adjuntar archivos a tickets.

Descripción general

Editoropendatahub-io
Repositorioai-helpers
Nombre de la habilidadjira-workitem-attach
Estrellas
39
Forks
76
Archivos incluidos
1
LicenciaApache-2.0
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Archivos incluidos: 1

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por opendatahub-io en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Jira Workitem Attach en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-jira/skills/jira-workitem-attach
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese 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
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Jira Workitem Attach en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Jira Workitem Attach automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Jira Workitem Attach no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo 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

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Son archivos de solo lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA Jira Workitem Attach?

Sube archivos adjuntos a tickets de Jira. Comprueba que el archivo existe y lo sube mediante la API de Jira. Úsala cuando el usuario quiera adjuntar archivos a tickets.

¿Por qué usar Jira Workitem Attach en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Jira Workitem Attach está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Jira Workitem Attach en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-jira/skills/jira-workitem-attach. TypingMind lee el archivo SKILL.md de esa carpeta, empaqueta los archivos de la carpeta e instala el conjunto como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Jira Workitem Attach?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Jira Workitem Attach?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Jira Workitem Attach con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Jira Workitem Attach?

Sí. opendatahub-io la ha publicado en GitHub bajo la licencia Apache-2.0. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇