Alerting

Why do Custom Alert Actions values of Yes or No in a selection take different values?

mkolkebeck
Path Finder

Is this a known bug?

Following along with the HipChat example code (linked below), if I change the Background Color control-group code to what is displayed in the first code snippet below, then action.hipchat.param.color takes on the values of 1 or 0 when saving the alert action form, instead of what I'd expect to be a "Yes" or "No" string value (respectively).

Excerpt of edited $SPLUNK_HOME$/etc/apps/hipchat_app/default/data/ui/alerts/hipchat.html
http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ModAlertsAdvancedExample

<div class="control-group">
    <label class="control-label" for="hipchat_color">Background Color</label>

    <div class="controls">
        <select id="hipchat_color" name="action.hipchat.param.color">
            <option value="Yes">Yes</option>
            <option value="No">No</option>
        </select>
        <span class="help-block">Change the background of the hipchat message.</span>
    </div>
</div>

This is an issue because when I go to pull up the alert action again, it does not load the correct param (the form expects a "Yes" or "No" value, but gets a 1 or 0).

As a workaround, I've had to edit the values to a 1 or 0 as such to get this to work as I expect it to:

<div class="control-group">
    <label class="control-label" for="hipchat_color">Background Color</label>

    <div class="controls">
        <select id="hipchat_color" name="action.hipchat.param.color">
            <option value="1">Yes</option>
            <option value="0">No</option>
        </select>
        <span class="help-block">Change the background of the hipchat message.</span>
    </div>
</div>
0 Karma

goelli
Communicator

Hi,

I came accross this old question via google search on alert on splunk-control-group topic. As there is not much information in docs and answers, it might be still relevant.

Did you specify action.hipchat.param.color in apps/README/alert_actions.conf.spec file as <boolean>? If so, you can change it to <string> and see, if it makes a difference?

Best regards

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...