Logo de Jira Workitem Attach

Jira Workitem Attach

Organização
opendatahub-io
jira-workitem-attach

Envie arquivos anexos para chamados do Jira. Verifica se o arquivo existe e faz o upload pela API do Jira. Use quando o usuário quiser anexar arquivos a chamados.

Visão geral

Publicado poropendatahub-io
Repositórioai-helpers
Nome da habilidadejira-workitem-attach
Estrelas
39
Forks
76
Arquivos incluídos
1
LicençaApache-2.0
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Arquivos incluídos: 1

    Scripts, templates e referências que o modelo pode ler enquanto trabalha. Os arquivos são somente para leitura e nunca são executados.

  • Código aberto

    Publicada por opendatahub-io no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Jira Workitem Attach no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-jira/skills/jira-workitem-attach
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse 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
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Jira Workitem Attach em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Jira Workitem Attach automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Jira Workitem Attach não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu 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

Arquivos incluídos

O modelo lê esses arquivos sob demanda enquanto a habilidade está carregada. Eles são disponibilizados para leitura e nunca são executados.

Perguntas frequentes

O que a habilidade de IA Jira Workitem Attach faz?

Envie arquivos anexos para chamados do Jira. Verifica se o arquivo existe e faz o upload pela API do Jira. Use quando o usuário quiser anexar arquivos a chamados.

Por que usar Jira Workitem Attach no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Jira Workitem Attach é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Jira Workitem Attach no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-jira/skills/jira-workitem-attach. O TypingMind lê o arquivo SKILL.md, reúne os arquivos da habilidade e a instala para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Jira Workitem Attach?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Jira Workitem Attach?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Jira Workitem Attach com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Jira Workitem Attach é gratuita?

Sim. A habilidade é publicada no GitHub por opendatahub-io sob a licença Apache-2.0. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇