Add slackFile field to element-level Image for Slack-hosted file references - #473
Merged
kbasutkar-hubspot merged 4 commits intoSep 25, 2026
Merged
Conversation
…rences Slack's API supports slack_file (file ID) on image elements, allowing images uploaded to Slack to be referenced by ID instead of a URL. This is needed for Card hero_image to reference Slack-hosted screenshots. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
opaliukh
reviewed
Sep 25, 2026
| @@ -23,4 +25,6 @@ default String getType() { | |||
Contributor
There was a problem hiding this comment.
It looks like this is optional now and we need to update it to allow providing an object without url, but this could be used in different repos, so please make sure that this change is safe.
Matches the pattern used by the top-level Image block where imageUrl is Optional<String>. When using slackFile (Slack-hosted file reference), imageUrl is not needed. Callers providing a URL should wrap it in Optional.of(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update CardBlockTest assertions and Image.of() calls to work with Optional<String> imageUrl. Apply spotless formatting. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
opaliukh
approved these changes
Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
Optional<SlackFileObject> getSlackFile()to the element-levelImageIF(com.hubspot.slack.client.models.blocks.elements.ImageIF).Problem
Slack's API supports
slack_file(file ID) on image elements, allowing images uploaded to Slack to be referenced by ID instead of a URL. The top-levelImageblock already has this field, but the element-levelImage(used byCard.heroImage,Section.accessory, etc.) does not.Change
One field added to
elements/ImageIF.java:Matches the pattern already used by the top-level
ImageIFblock.Use case
The Slack integration team needs to reference Slack-uploaded screenshots in
Card.heroImagefor Breeze artifact preview cards. Without this field, we have to host images ourselves instead of letting Slack handle storage.