<style>p { margin: 0; }span.fr-emoticon.fr-emoticon-img { background-repeat: no-repeat !important; font-size: inherit; height: 1em; width: 1em; min-height: 20px; min-width: 20px; display: inline-block; margin: -0.1em 0.1em 0.1em; line-height: 1; vertical-align: middle; } span.fr-emoticon { font-weight: normal; font-family: "Apple Color Emoji", "Segoe UI Emoji", "NotoColorEmoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols"; display: inline; line-height: 0; } blockquote { border-left: solid 2px #5e35b1; color: #5e35b1; margin-left:0; padding-left:5px;}blockquote blockquote{ border-color: #00bcd4; color: #00bcd4;}blockquote blockquote blockquote{ border-color: #43a047; color: #43a047;} table.grid{ border-collapse: collapse;} table.grid td, table.grid th { border: 1px solid #ddd;} .fr-fic.fr-dib{ display: block; margin: 5px auto;}.fr-fic.fr-dib.fr-fir{ text-align: right; margin: 5px 0 5px auto;}.fr-fic.fr-dib.fr-fil{ text-align: left; margin: 5px auto 5px 0;}.fr-fic.fr-dii{ float: none; margin: 5px auto;}.fr-fic.fr-dii.fr-fil{ float: left; margin: 5px auto;}.fr-fic.fr-dii.fr-fir{ float: right; margin: 5px auto;}img.fr-dib.fr-fir { margin-right: 0; text-align: right;}img.fr-dib.fr-fil { margin-left: 0; text-align: left;}img.fr-dib { margin: 5px auto; display: block; float: none;}img.fr-bordered { box-sizing: content-box; border: solid 5px #CCC;}img.fr-shadow { box-shadow: 10px 10px 5px 0px #cccccc;}img.fr-rounded { border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; -moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box;}</style><p><strong>In this guide we will cover: </strong></p><p><strong>- What are Runbook Level variables? </strong></p><p><strong>- Creating Runbook Variables</strong></p><p><strong>- Configuring Variables</strong></p><p><strong>- Worked Example</strong></p><p><br></p><p><br></p><p><strong>Related Guides: </strong></p><ul><li><strong><a target="_blank" rel="noopener noreferrer" data-fr-linked="true" href="https://usehalo.com/haloitsm/guides/1630/" data-pasted="true">Custom Integrations/Runbooks</a></strong></li><li><strong><a target="_blank" rel="noopener noreferrer" data-fr-linked="true" href="https://usehalo.com/haloitsm/guides/2660" data-pasted="true">Custom Integrations</a></strong></li></ul><p><br></p><p><br></p><p><strong><span style="font-size: 14pt;">What are Runbook Level Variables? </span></strong></p><p>When obtaining data from the API chances are you are not going to want the <em>entire </em>response body, but only particular parts of the response.</p><p><br></p><p>Runbook variables are used within <a href="https://usehalo.com/haloitsm/guides/1630/" target="_blank" rel="noopener noreferrer">Integration Runbooks</a> to define and store a particular part of a response body, these values later in the runbook for further requests. </p><p><br></p><p>In this guide we will outline how to create and use runbook level variables, we recommend reading <a target="_blank" rel="noopener noreferrer" data-fr-linked="true" href="https://usehalo.com/haloitsm/guides/1630/" data-pasted="true">Custom Integrations/Runbooks</a> prior to this guide. </p><p><br></p><p><strong><span style="font-size: 14pt;">Creating Runbook Variables </span></strong></p><p> Variables can be setup under the "Details" tab of the runbook, and per step. </p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImMyMTRkMDcyLTAxYTQtNDlhYi05ODE1LTE4MWVhOTg1ZTJhNCJ9.Wn1BuOLg8v5QetCnNuECEGY4-RKTUt3N-PgBD9VMUAE" class="fr-fic fr-fil fr-dib" width="1170" style="width: 1172px; height: 449.747px;" height="450"></p><p><strong><span style="font-size: 10pt;">Fig 1. Add variables under Details Tab</span></strong></p><p><br></p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ1M2ZmN2RhLWVkOTAtNDE4YS1iYmFiLWNkNGMyODhjOTNhOSJ9.Ni_Y8YDgsg24ClmbpLjAJNkvBEVqX3IqjLAtXBFRfbE" class="fr-fic fr-fil fr-dib" width="1175" style="width: 1177px; height: 426.824px;" height="427"></p><p><strong><span style="font-size: 10pt;">Fig 2. Add variables at step </span></strong></p><p><br></p><p>The location that the variable needs to be added/configured will depend on which stage of the runbook the data you looking to extract is available. </p><p><br></p><p><strong><span style="font-size: 12pt;">Adding Variables Under the Details Tab</span></strong></p><p>Variables added under the details tab extract and store data from the request that triggered the runbook to run. For example, if the runbook is triggered when a new asset is created, the request will contain information about the asset that was created. Information about said asset can then be extracted and stored in a variable. </p><p><br></p><p>As the variables created here are extracting data from the initial request, when configuring the value of the variable, this must begin with "request". </p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImM2MzBiMTRkLWIxODQtNGRmOS05NTdmLTQxYzg4MjdhMTNlZiJ9.cP6BCFUW0LC2_DaosJocj_MVQzEE9s1PRTnaGVBE9RU" class="fr-fic fr-fil fr-dib" width="1395" style="width: 1397px; height: 323.062px;" height="323"></p><p><strong><span style="font-size: 10pt;">Fig 3. Variable to extract data from initial request</span></strong></p><p><br></p><p><strong><span style="font-size: 12pt;">Adding Variables within the Step </span></strong></p><p>Within each runbook step you can create new variables to extract and store data that is obtained at this same step. You can also extract data from the response of the step to update existing runbook variables.</p><p><br></p><p>When adding a new variable for the step you will be given the option to have a new variable created at this step, or update an existing one. </p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjJiYjMxNzdjLTIxN2MtNDQ5NS1iODBmLTk2N2JjNDAwNjM2YiJ9.s4rDAvcZGAqtDT5jHhN9YLqhzFKrWi-gEjB0tgsciok" class="fr-fic fr-fil fr-dib" width="600" style="width: 602px; height: 290.132px;" height="290"></p><p><strong><span style="font-size: 10pt;">Fig 4. Choosing to add or update a Runbook level variable </span></strong></p><p><br></p><p>The variables here can extract data from the response to the step. For example, if the step is executing a GET on assets, it will return a body of asset information as the response. Information about these assets (from the response) can then be stored in a variable, or update the value of an existing variable. </p><p><br></p><p data-pasted="true">As the variables created here are extracting data from the response, when configuring the value of the variable, this must begin with "response". </p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImM3NmMwZDFjLTE4ZDgtNDA5MC1iYTQyLWIzMzk0ZjY5ZTg1ZiJ9.Q3MOoaStVSiWMWpq7Z1pKn4g3OgnHP8aAA2xBPlNLpA" class="fr-fic fr-fil fr-dib" width="1310" style="width: 1312px; height: 242.35px;" height="242"></p><p><strong><span style="font-size: 10pt;">Fig 5. Variable to extract data from the response to the step</span></strong></p><p><br></p><p><strong>Output Level Variables</strong></p><p>You will notice an additional option on runbook steps to configure "Output level variables". </p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImMwNTMwYWQwLWY5NDktNGQwNC04NzExLTQ5YTgzMmJmMzVjOSJ9.Phl8cChp2FMflGbJ1mqR4W7OYBEmUJtqTHNtaoY_XZs" class="fr-fic fr-fil fr-dib" width="1353" style="width: 1355px; height: 413.808px;" height="414"></p><p><strong><span style="font-size: 10pt;">Fig 6. Output Level variables</span></strong></p><p><br></p><p>These variables are configured in the same way as runbook level variables but do not have as much functionality and flexibility as runbook level variables. Therefore we recommend using runbook level variables. </p><p><br></p><p>Output level variables cannot have their values updated by each step of the runbook, they also have fewer operators available to control how data is extracted from the response. However, they can make testing integration methods easier. This is because output level variables can be configured within an integration method, this means when testing the method on it's own, you can see if the variables populate correctly. </p><p><br></p><p>If you are configuring output level variables, these should not be contained within "<<>>" tags. </p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Ijc3Njg4YjdhLTg4NTItNGE2ZC1hYjlmLTY3NzVmYjQyYWZlMCJ9.7C1ah_zU9Yp3vUnQ4YJ9dhZc-zBv8lsTAI104uruUAQ" class="fr-fic fr-fil fr-dib" width="1350" style="width: 1352px; height: 153.017px;" height="153"></p><p><strong><span style="font-size: 10pt;">Fig 7. Example Output variable</span></strong></p><p><br></p><p><strong><span style="font-size: 14pt;">Configuring Variables </span></strong></p><p>Once you have decided where you will need to add your variable(s) you can begin configuring them. </p><p><br></p><p>Adding a new variable will bring up the screen shown in figure 8. </p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImUwMWQ2NGRmLTQ5MmEtNDQ5Ni1iMzhiLTYzMzQ1MTBiMzAxNyJ9.-sSzDiGJmySSm-0jjQiGlW7Vqz6hFRUJ8O6i3wcWzRE" class="fr-fic fr-fil fr-dib" width="529" style="width: 531px; height: 684.028px;" height="684"></p><p><strong><span style="font-size: 10pt;">Fig 8. New runbook Level Variable Screen</span></strong></p><p><br></p><p><strong>Name -</strong> Give the variable a sensible name. This must be unique and will be used later to use the variable. </p><p><span style="color: rgb(0, 0, 0);"><strong>Data type - </strong>Here choose the type of data that is stored in this variable. This will impact how the variable is returned, therefore how it can be processed in later steps, so ensure you select the correct type. </span></p><p><strong>Description -</strong> You can add a description to the variable for reference. </p><p><strong>Value -</strong> This controls value the variable stores. This should start with "response" or "request" and contain the operators used to extract the data required. More information on this below.</p><p><br></p><p><strong><span style="font-size: 12pt;">Configure Variable Value</span></strong></p><p>The variable value will always start with "response" or "request". </p><ul><li>Request is used when extracting data from the initial request that triggered the runbook.</li><li>Response is used when extracting data obtained from a particular runbook step. </li></ul><p><br></p><p><strong>Extract Child Properties </strong></p><p>Child properties of the response/request are referenced using ^. </p><p><br></p><p>In the figure 9 example the response of my step returns the ticket information for the ticket that triggered the runbook.</p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImQ4YWJmNTAzLWFiMjUtNDdiMy1iZDc3LTZhODUxNDQ0ZTY5MiJ9.MRWbuo9GEKN3Za5EQaTQjZNutgxluY8fUOe_0-CYv80" class="fr-fic fr-fil fr-dib" width="886" style="width: 888px; height: 399.882px;" height="400"></p><p><strong><span style="font-size: 10pt;">Fig 9. Example Response</span></strong></p><p><br></p><p>The summary of the ticket returned is contained within the "summary" child property. Therefore to extract the ticket summary, the following value configuration will be used: </p><ul><li><<response^summary>></li></ul><p><br></p><p><strong>Extract a chosen Index within an Array</strong></p><p><span style="color: rgb(0, 0, 0);">If the response returns an array (a list) of data, you will need to specify which index of this array you would like to take data from, the 1st, 2nd, 3rd, etc. This is done using the [x] operator, where x is the item in the index you want. </span></p><p><br></p><p>In the figure 10 example the response of my step returns all the assets associated with the ticket that triggered the runbook. </p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjhhMjA2NjI2LTNkZDEtNGM3MS04ZWYxLTMyZGEwYjMyN2Y1ZSJ9.Ya5qJn5-SYtTKThWnByrZxdYsUwoPpKOIgAnC8ON4ac" class="fr-fic fr-fil fr-dib" width="896" style="width: 898px; height: 403.767px;" height="404"></p><p><strong><span style="font-size: 10pt;">Fig 10. Response containing asset information for a particular ticket</span></strong></p><p><br></p><p>The asset information is contained within the "asset" property. Therefore to return the information about only the first asset the following value configuration will be used:</p><ul><li><<response^assets[0]>></li></ul><p data-pasted="true">Child properties of this index can then be extracted. For example, to obtain the id of only the first asset the following value configuration can be used:</p><ul><li><<response^assets[0]^id>></li></ul><p><br></p><p><strong><em>Note: If you need to evaluate every index within this array, rather than a chosen one, you will need to create an additional step in the runbook to iterate through each index in the array. This will not be covered in this guide. </em></strong></p><p><br></p><p><strong>Extract an Object that has a Specific Value</strong></p><p>If the response is an array, and you need to extract the first object in this array based on a property being equal/not equal to a specific value you can use [prop=value] or [prop!value]. </p><p><br></p><p>Using the figure 10 example, I want to extract the first asset that has an "active" status (in our instance this status has id=0). Therefore to return the asset data for the asset that is active the following value configuration will be used:</p><ul><li><<response^assets[status_id=0]>></li></ul><p><br></p><p>If you would like to extract all objects in the array that meet criteria (not just the first one), use [filter:prop=value] or [filter:prop!=value]. </p><p><br></p><p>You can also use this operation to extract objects based on one of the object properties being > or < a chosen value. For example, <<response^assets[status_id>1]>> will return all assets that have a status id of 2 or greater. </p><p><br></p><p>You can also use "contains" within this operation to extract objects based on one of the object properties being containing a specific value. For example, <<response^assets[assettype_name contains Laptop]>> will return assets that have an asset type name that contains the string "Laptop". </p><p><br></p><p><strong><em>Note: Variables can also be used as the comparative value here. For example, <<response^assets[assettype_name contains <<affected_asset_type>>]>> will return assets that have an asset type name containing the value pulled through by<<affected_asset_type>>. Allowing you to use the value of a previous variable to populate/update new variables.</em></strong></p><p><br></p><p><strong>Remove "" from variable values</strong></p><p>An exclamation mark "!" can be appended to a variable to remove the "" marks around it. Any values wrapped in quotation marks will be treated as a string. Therefore if the value returned is not a string the quotation marks will need to be removed to allow the value to be treated correctly. </p><p><br></p><p>Using the figure 10 example, I want to extract the third party id from the first asset. As the ID is an integer and not a string the "" will need to be removed to ensure the value is treated correctly in further steps. Therefore to return this id the following value configuration will be used: </p><ul><li><<response^assets[0]^id!>></li></ul><p><br></p><p><strong>Print the current date/time</strong></p><p><span style="color: rgb(0, 0, 0);">The variables $-now and $-utcnow (without the hyphens) can be used as the variable value to create a variable that prints the current time. Useful when you would like to audit the time the runbook step was carried out.</span></p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVhZTZiMGQxLTcyZDgtNGJhNS1hODZlLWFjYzkyYjdiZmIyNSJ9.4XBrqXxZqPUQbEMxN5nK-9vQ5B7kssYHw6yJl0tsjrk" class="fr-fic fr-fil fr-dib" width="529" style="width: 531px; height: 625.884px;" height="626"></p><p><strong><span style="font-size: 10pt;">Fig 11. Variable to print current time at run</span></strong></p><p><br></p><p><strong>Apply calculations to variable values</strong></p><p>Calculations can be configured within a variable value, so you can store derived values, rather than only values directly available in the API. This is done by wrapping the values you would like to calculate with ##calc## and ##/calc##. </p><p><br></p><p><span style="color: rgb(0, 0, 0);">Useful for pagination as this allows you to add one to the variable value each time it is updated. </span></p><p><br></p><p><span style="color: rgb(0, 0, 0);">For example, the variable <<TicketPageNumber>> stores the first page of the endpoint that data is being returned from. Only one page of data can be returned at a time, therefore multiple requests will need to be made, one to each page. <<TicketPageNumber>> is used to determine the first page data is pulled from, then this variable can be updated using a calculation to +1 to the value of this variable each time the previous page of data has been iterated through. </span></p><p><br></p><p><span style="color: rgb(0, 0, 0);">The following value configuration will be used in this scenario :</span></p><ul><li style="color: rgb(0, 0, 0);">##calc##<<TicketPageNumber+1>>##/calc##</li></ul><p><br></p><p data-pasted="true"><strong>Value Mappings</strong></p><p>When creating variables with the following data types you can create value mappings for the variable: </p><ul><li>string</li><li>int</li><li>float</li><li>bool</li></ul><p><br></p><p>Value Mappings allow you to map the values the variable could return to alternative values. The associated alternative value will then be returned when this variable is used.</p><p><br></p><p>In the figure 12 example I have created a variable that returns an supplier id of an asset. However, I do not want the id of the supplier, I want to see the supplier name. Therefore, I have created a mappings table that maps each supplier name to their associated ID. </p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImM5ZmYyZTUwLTk0YmYtNGE3OS1hMDY1LTE3NTJmMmQ5MzJjZCJ9.2F7J1zs02HApQHI-jH-TzqB9U9ody0AKakYnAvInzuI" class="fr-fic fr-fil fr-dib" width="548" style="width: 550px; height: 354.11px;" height="354"></p><p><strong><span style="font-size: 10pt;">Fig 12. Value mappings to map supplier name to ID</span></strong></p><p><br></p><p>When setting up values ensure any strings are wrapped in quotation marks "". </p><p><br></p><p>A * can be used as a catch all. If the variable returns a value that does not have a mapping, the output value mapped to the * value will be used. </p><p><br></p><p><strong>JSON Escaped Variables</strong></p><p>JSON escaped variables can be used to covert the JSON returned by a variable into a string. Used when your variable contains JSON but you want to POST this JSON as a string. This is done using the following format:</p><p style="margin: 0px;"><br></p><ul><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px;" data-pasted="true">##jsonstringify##<<ticket^example_field>>##/jsonstringify##</li></ul><p>From v2.232+ ##JSONSTRINGIFY## can be used with data that spans multiple lines. </p><p><br></p><p><strong>Pre-Created Variables</strong></p><p>Each runbook step will have some available variables pre-configured for you. </p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQwNzYxYWNlLWU5NmEtNDFhZS1hYmM5LTAyOWUwOWEwOTE2MiJ9.OLa2brGDAtMNnQV_lrm1GBvJQI4YQFgfKp8Q3tQBRpQ" class="fr-fic fr-fil fr-dib" width="1633" style="width: 1635px; height: 635.784px;" height="636"></p><p><strong><span style="font-size: 10pt;">Fig 13. Available variables on runbook step</span></strong></p><p><br></p><p>Variables here are organised by the entity they relate to, ticket, asset, customer etc. Variables under the "Runbook" entity here, show all the runbook level variables you have configured as well as some other handy variables., such as a variable to return the URL of your Halo instance. </p><p><br></p><p>To use these variables, the runbook must be triggered from a corresponding event. For example, in order to use any of the ticket variables, the runbook must be triggered from a ticket related event. If the runbook was triggered from an asset related event you will not be able to use the ticket variables here, you will need to configure your own. </p><p><br></p><p><strong><em>Note: If your runbook is not triggered by an event, if it runs on a schedule, you will not be able to use any of these variables. </em></strong></p><p><br></p><p>When an entity is chosen you will be given a list of pre-available variables related to this entity that you can use. Hovering over a variable will tell you the data it obtains. </p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjlmMWMyMjk2LWZjMzItNGI1ZC05MjBkLTY5ZjFmZjJkOGVkYiJ9.2dSMWi_g2K4COd9ZPmq9qMiIGsH1XHZi7YmneBfa964" class="fr-fic fr-fil fr-dib" width="559" style="width: 561px; height: 409.122px;" height="409"></p><p><strong><span style="font-size: 10pt;">Fig 14. Available Ticket Variables</span></strong></p><p><br></p><p>Selecting a variable in this list will paste the variable onto the text box you currently have selected.</p><p><br></p><p><strong><span style="font-size: 14pt;">Persistent Runbook Variables</span></strong></p><p>Runbook level variables can be set to persist between runs. When set to persist the value of the variable from the previous run will be saved, when run again the value from the previous run will be used, until the variable is updated. Useful for storing deltas e.g last updated date. </p><p><br></p><p>The current value of a persistent runbook variable also be seen and reset from the runbook variable configuration screen. Useful to store and reference information about this runbook. </p><p><br></p><p>This functionality can be enabled against each runbook level variable, as shown in figure 15. </p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjkxYTg2YmNiLTNkOGQtNDcxMS05ZDA1LTZlZDM3ZDZkOWJiYiJ9.0vDs-d4av-FZntkJpxcHoLbbHSxUPMF0lIS7_GoKm4k" class="fr-fic fr-fil fr-dib" width="503" style="width: 505px; height: 494.479px;" height="494"></p><p><strong><span style="font-size: 10pt;">Fig 15. Option to persist the value of this variable between runs of this runbook</span></strong></p><p><br></p><p>When enabled, the value of this variable during the last run of the runbook will be visible from here. </p><p><br></p><p data-pasted="true"><strong><span style="font-size: 14pt;">Worked Example</span></strong></p><p>In this example we will create a runbook that will create a ticket in another tool when a chosen action is carried out in our Halo instance. When this ticket is created information our ticket in our Halo will be send to the to another tool. Variables will be used to determine which information is sent over. </p><p><br></p><p>We start by creating a new runbook. Give the runbook an event trigger that will cause the runbook to be triggered when an agent adds the action "Send to other tool" to a ticket that has the ticket type "Incident". Shown in figure 16. </p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjNkMzdhZjIyLWY2Y2ItNDUxYi1hNzUwLTY0MGI1M2YzZjRlOSJ9.XO6d-jhxOdAtFP9XL6xuUhrFpkAd-uGSG1eKI--VHAQ" class="fr-fic fr-fil fr-dib" width="598" style="width: 600px; height: 533.858px;" height="534"></p><p><strong><span style="font-size: 10pt;">Fig 16. Event Trigger for Runbook </span></strong></p><p><br></p><p>Now, add a step to the runbook. This step will need to be setup as shown in figure 17. </p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImI3YjUyYWNiLTQwZTMtNDFiNi1iYzU4LTA1MDg4MmZkYzk2OCJ9.hPcrg51suwfwe4sePTN9GjE2eGeaAllJi2eT06tJuUw" class="fr-fic fr-fil fr-dib" width="1385" style="width: 1387px; height: 544.951px;" height="545"></p><p><strong><span style="font-size: 10pt;">Fig 17. Step to Obtain Ticket Details</span></strong></p><p><br></p><p>This step is executing a Halo API action to obtain ticket details of a ticket from our own instance. We have used the key "ticket_id" to control which ticket in our instance we get details of. We have used a pre-configured variable here: <<ticket_id>>, this will set the value of the key to be the id of the ticket that triggered the start of the runbook. </p><p><br></p><p>Executing this step on it's own will return much more data than we need, so we will create some runbook level variables at this step to extract and hold the data we want. We are looking to obtain the following details: </p><p data-pasted="true">⦁<span style="white-space:pre;"> </span>Ticket ID</p><p>⦁<span style="white-space:pre;"> </span>Summary of the ticket</p><p>⦁<span style="white-space:pre;"> E</span>nd user of the ticket</p><p>⦁<span style="white-space:pre;"> The primary service of the ticket</span></p><p>⦁<span style="white-space:pre;"> The content in the custom field CFBusinessImpact </span> </p><p><br></p><p>Now add new variables to the Runbook-level variable mappings table within the step. The variables will be configured as shown in figure 18. </p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImU1MDFjZjkyLTQxYTktNGE0ZS05MjVkLTQwOWJkZjMzZDgyZSJ9.VGp1dTKOuMClDwG2_AVbtLL0l18RKVi_yWkBdpFXSCQ" class="fr-fic fr-fil fr-dib" width="1268" style="width: 1270px; height: 654.519px;" height="655"></p><p><strong><span style="font-size: 10pt;">Fig 18. Variables to hold Ticket Information</span></strong></p><p><br></p><p>All the variable values here begin with "response" and reference a child property of the response using ^. For example, the property "summary" is a child property within the response. </p><p><br></p><p>Data in the custom field "<span style="white-space:pre;" data-pasted="true">CFBusinessImpact</span>" is stored in the child property "customfields", this property returns an array of all the custom fields added to the ticket type. CFBusinessImpact is the first custom field retuned in the array, therefore we used the [0] operator. If we used <<response^customfields[0]>> alone, this would return the whole custom field object, as we only want the html content in the field, ^display is appended to obtain this property of the object only. </p><p><br></p><p>Now we have created our runbook level variables, add another step to the runbook to send this data to the desired tool.</p><p><br></p><p>This step will need to "Execute an Integration Method". You will need to create a new method. </p><p><br></p><p>This method will need to execute a POST request to send the information over to your desired tool. The body of the post will need to contain the variables you created. </p><p><br></p><p>You can easily add your variables into the body by selecting the variables from the available list on the right-hand side of the page.</p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImJiNmM5ZGI0LTQ3MDctNGUxYi05YzM2LWNiMjJiNzY1YTNmYiJ9.DYEfLJ6ynZvZwvcSpcPyrFQ8aPqmkO17TafFb70VrUk" class="fr-fic fr-fil fr-dib" width="1541" style="width: 1543px; height: 667.828px;" height="668"></p><p><strong><span style="font-size: 10pt;">Fig 19. Adding variables into Request Body</span></strong></p><p><br></p><p>The variables will need to be used as the value for the JSON property/value you are looking to update. We have included example JSON keys here, but these will change based on where you are sending the request. </p><p> </p><p>Save the method, step and the runbook. Now, each time an agent uses the "Send to other tool" action the runbook will run, obtaining the required ticket details and storing these details in variables. These variables are then used to send the chosen information onto the desired endpoint. </p><p><br></p><style data-pasted="true">.pf0{}</style>