3.x: blank "attachment" setting is treated as "none", silently dropping the alert card that 2.2.0 showed
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
Research direction
The default is set in _build_config() in package/bin/slack_logic.py, around line 54, and the three attachment branches are in process_event(). Compare how a blank value is handled there against the 2.2.0 behaviour described in the issue. Done means blank, unset, none, alert_link and message produce the same Slack payload as 2.2.0, and any existing tests for that module still pass.
Written by the indexing model from the issue text.
Description
Describe the bug
_build_config() in package/bin/slack_logic.py (line 54 on main):
"attachment": helper.get_param("attachment") or "none",
Alerts saved through the UI often end up with a blank value (action.slack.param.attachment =).
- 2.2.0: a blank value is not
"none", becauseconfig.get('attachment', 'none') != 'none'. So the message includes the attachment card: the:bell: <search name>title linking to the alert, Show results in Splunk, and the footer. - 3.x:
or "none"turns a blank value into"none", so the same alert posts plain text with no links. Nothing is logged, so the change goes unnoticed until someone looks at the channel.
To Reproduce
- On 2.2.0, create a Slack alert with
action.slack.param.attachment =(blank) and a message. Trigger it: the message shows the alert card with links. - Upgrade to 3.1.0 or 3.1.1 and trigger the same alert.
- The message is now plain text, with no title link, "Show results in Splunk" link or footer.
Expected behavior
Same output as 2.2.0. Only an unset attachment should mean "none".
Suggested fix (running on our test search head cluster)
attachment_param = helper.get_param("attachment")
attachment = "none" if attachment_param is None else attachment_param
With this, the three attachment checks in 3.x behave the same as 2.2.0's. We ran the real 2.2.0 slack.py and the patched 3.1.0 process_event() side by side, with network calls stubbed, against the same first result. The Slack JSON was byte-identical for attachment set to none, alert_link, message, blank, unset and an invalid value.
Splunk Environment:
- Splunk Version: 9.4.13
- OS: Linux
- Cloud: no (self-hosted search head cluster)
- App version: 3.1.0; the code is unchanged in 3.1.1
Additional context
First reported in discussion #72. Two other differences from 2.2.0 that we noticed may be intentional, but neither is in the changelog:
- multivalue fields in the fields attachment now show all values; 2.2.0 showed only the first;
fields = *now also lists the internal__mv_<field>columns andrid.
Happy to open a PR.
- Dominant language
- Python
- Stars
- 21
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from splunk/slack-alerts
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
splunk/slack-alerts#73 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
splunk/slack-alerts#16 ·
-
Getting validation error when inputting proxy host in configuration menuMay be free again @dtwersky claimed this 66 days ago, and no pull request is open. Openbug
splunk/slack-alerts#66 · 1 assignee ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
splunk/slack-alerts#59 · 2 comments ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 30/100
splunk/slack-alerts#54 ·
All issues in splunk/slack-alerts
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
roman-corgi/corgisim#327 ·
Maintainers usually reply within 2 days
-
[Bug]: opencode_go chat route drops reasoning_effort (even 'none'), while the same endpoint honors it via custom_llm_provider=openaiPossibly taken @arvindkumar-ship-it claimed this today. Openllm translation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
BerriAI/litellm#51871 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
PolicyEngine backdates South Carolina’s EITC into 2015–2017Possibly taken @MaxGhenis claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PolicyEngine/policyengine-us#10944 ·
Maintainers usually reply within 2 days
-
fix(frontend): resolve SSE parser crash on unhandled Ref methods and undefined actions identifierOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
kodokbakar/MiroFish-Local#94 ·
Maintainers usually reply within 1 day