All Apps and Add-ons

How to create a Remedy Ticket from Splunk via form/dashboard

Explorer

The requirement I have is to create a remedy ticket using Splunk. Currently i have configured the Splunk Add-On for BMC remedy which provides a custom generating command remedyincidentcreate.

I have tested the command by itself and populated it with test data to confirm if ticket creation is working. This appears to be working perfectly. I want to transfer this query to a dashboard with form input which would allow users to fill up the required ticket details and create remedy tickets from the Splunk interface.

Dashboard XML below

 <form stylesheet="SA-Remedy:sd_createticket.css" script="SA-Remedy:textarea.js">
          <label>Create Ticket</label>
          <fieldset submitButton="true" autoRun="False">
            <input type="text" token="impact">
              <label>Impact</label>
              <default>4000</default>
            </input>
            <input type="text" token="urgency">
              <label>Urgency</label>
              <default>4-Low</default>
            </input>
            <input type="text" token="service_type">
              <label>Service Type</label>
            </input>
            <input type="text" token="categorization_tier_1">
              <label>Categorization Tier 1</label>
              <default>Security Incident</default>
            </input>
            <input type="text" token="categorization_tier_2">
              <label>Categorization Tier 2</label>
              <default>NA</default>
            </input>
            <input type="text" token="categorization_tier_3">
              <label>Categorization Tier 3</label>
              <default>NA</default>
            </input>
            <input type="text" token="prod_tier_1">
              <label>Product Categorization Tier 1</label>
              <default>NA</default>
            </input>
            <input type="text" token="prod_tier_2">
              <label>Product Categorization Tier 2</label>
              <default>NA</default>
            </input>
            <input type="text" token="prod_tier_3">
              <label>Product Categorization Tier 3</label>
              <default>NA</default>
            </input>
            <input type="text" token="prod_name">
              <label>Product Name</label>
              <default>NA</default>
            </input>
            <html>
              &lt;br/&gt;
            </html>
            <input type="text" token="summary" searchWhenChanged="false" id="input_subj">
              <label>Summary</label>
            </input>
      <html>
          <span title="This field must be updated for submit to work. Please use fields above to override Host/User values.">Detailed Description</span>
          &lt;br/&gt;
            <textarea id="ta_task_comment" token="details">
              Notes go here
            </textarea>
        </html>
          </fieldset>
          <row>
            <panel>
              <table>
                <search>
                  <query>|remedyincidentcreate --First_Name="<first name>" --Last_Name="<last name>" --Status="New"  
                            --Impact=$impact|s$ --Urgency=$urgency|s$ --Service_Type=$incident_type|s$ --Reported_Source="<source>" 
                            --Categorization_Tier_1=$categorization_tier_1|s$ --Categorization_Tier_2=$categorization_tier_2|s$
 --Categorization_Tier_3=$categorization_tier_3|s$
                            --Assigned_Support_Company="<support company>" 
                            --Product_Categorization_Tier_1=$prod_tier_1|s$ 
                            --Product_Categorization_Tier_2=$prod_tier_2|s$
                            --Product_Categorization_Tier_3=$prod_tier_3|s$ 
                            --Product_Name=$prod_name|s$
                            --Assigned_Support_Organization="<org name>" --Login_ID="<login name>" --Summary=$summary|s$
                            --Notes=$details|s$
                    </query>
                </search>
              </table>
            </panel>
          </row>
        </form>

The main problem with this dashboard is that there is no feedback on the UI when the submit button is clicked. This appears to be an issue with token passing. If i hard-code test data into the query given above the dashboard panel will display the result of the created ticket.

I can't seem to figure what the problem is. Is there a limitation on the types of queries that can be executed from simple XML dashboards, since this is a custom generating command.

0 Karma
1 Solution

Contributor

I had similar task couple years ago, my suggestion is to add simple js controls to your dashboard. Moreover, you may want to validate these user inputs in your js code as well. I remember adding simple js alert to submit button and dispay, what are the tokens just before i pass it to my dashboard. Fail or auto-correct the user input is possible this way, if something is wrong in the tokens. Here is the documentation link for js,
http://dev.splunk.com/view/dev-guide/SP-CAAAE25
there are also good examples in Splunk Dashboard Examples App.
https://splunkbase.splunk.com/app/1603/

View solution in original post

0 Karma

Contributor

I had similar task couple years ago, my suggestion is to add simple js controls to your dashboard. Moreover, you may want to validate these user inputs in your js code as well. I remember adding simple js alert to submit button and dispay, what are the tokens just before i pass it to my dashboard. Fail or auto-correct the user input is possible this way, if something is wrong in the tokens. Here is the documentation link for js,
http://dev.splunk.com/view/dev-guide/SP-CAAAE25
there are also good examples in Splunk Dashboard Examples App.
https://splunkbase.splunk.com/app/1603/

View solution in original post

0 Karma

Explorer

Thanks I finally got it to work. Your answer pushed me in the right direction. Used some token debugging features that were present in the Splunk Web framework toolkit app. Then i started from scratch and used some of the code from the following answer.

https://answers.splunk.com/answers/247799/is-it-possible-to-create-a-textarea-in-html-and-ha.html

0 Karma