Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Add attachment_mention rich text element (currently parsed as RichTextUnknownElement, losing url and text)

Abierto
#1,657 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
75/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java
Área
api

Línea de trabajo

Start in GsonRichTextElementFactory, which has no case for attachment_mention and so falls back to RichTextUnknownElement, and follow the existing Canvas element as the pattern for a typed rich text element. Add an AttachmentMention model with url, text, app_id, entity_id, icon_url and the other fields in the issue's JSON sample, register it in the factory, then add a JSON parse test. Done when the sample message parses to the typed element and serializes back with its fields intact.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement project:slack-api-model

Summary
Messages that contain an app-unfurled link (e.g. a Jira Cloud issue link) carry an attachment_mention element inside the rich_text block. GsonRichTextElementFactory has no case for it, so it is deserialized as RichTextUnknownElement. The SDK keeps only type; url, text and the other fields are lost. The element is documented here: https://docs.slack.dev/reference/block-kit/block-elements/attachment-mention-element

Reproduce

Fetch a message that contains a pasted Jira issue link:

GET https://slack.com/api/conversations.replies?channel=C…&ts=…&limit=1
Authorization: Bearer xoxb-…

The raw response contains:

{
  "type": "rich_text",
  "elements": [{
    "type": "rich_text_section",
    "elements": [
      { "type": "text", "text": "read this => " },
      {
        "type": "attachment_mention",
        "url": "https://example.atlassian.net/browse/ABC-5",
        "text": "Issue title",
        "app_id": "A…",
        "entity_id": "W:A…:…",
        "icon_url": "https://product-integrations-cdn.atl-paas.net/jira-issuetype/large/new/task.png",
        "icon_name": "brand-jira-filled",
        "product_name": "Jira Cloud",
        "channel_id": "C…",
        "ts": "…"
      }
    ]
  }]
}

With slack-api-model 1.52.0 the element is parsed as RichTextUnknownElement and serializes back as {"type":"attachment_mention"}. message.text still contains <https://example.atlassian.net/browse/ABC-5|Issue title>, but nothing in blocks carries the link.

Expected

A typed RichTextSectionElement.AttachmentMention (url, text, app_id, entity_id, icon_url, ...) registered in GsonRichTextElementFactory, like Canvas.

Notes

  • slack_sdk (Python) 3.45.0 and @slack/types 3.2.0 don't model it either. The Python SDK has an open draft PR: https://github.com/slackapi/python-slack-sdk/pull/1948
  • I'm happy to open a PR with the model class, the factory entry and a JSON parse test if this is something you'd accept.
Category (place an x in each of the [ ])
  • bolt (Bolt for Java)
  • bolt-{sub modules} (Bolt for Java - optional modules)
  • slack-api-client (Slack API Clients)
  • slack-api-model (Slack API Data Models)
  • slack-api-*-kotlin-extension (Kotlin Extensions for Slack API Clients)
  • slack-app-backend (The primitive layer of Bolt for Java)
Requirements
Lenguaje dominante
Java
Estrellas
602
Forks
235
Merge medio
2 d 1 h
PR fusionados (30 d)
7

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de slackapi/java-slack-sdk

Todos los issues de slackapi/java-slack-sdk

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.