Skip to content

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

Open

Description

@somnathvats-cpu

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

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

Activity

  1. cchensh commented on Oct 14, 2026

    @cchensh

    Thanks for the clear report! Confirmed: attachment_mention falls through to RichTextUnknownElement in GsonRichTextElementFactory (or throws when failOnUnknownProperties is on), so the url/text fields are dropped. We'll work on adding RichTextSectionElement.AttachmentMention with a factory case and a parse test, and keep the field names in sync with the Python SDK (slackapi/python-slack-sdk#1948). We'll update this issue when it's ready.

  2. added
    enhancementM-T: A feature request for new functionality
    and removed on Oct 14, 2026
  3. cchensh commented on Oct 14, 2026

    @cchensh

    cc @WilliamBergamin about this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions