<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Returning output from scripts that run on indicators to the war room in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/returning-output-from-scripts-that-run-on-indicators-to-the-war/m-p/524972#M1569</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am playing around with buttons on indicator layouts. The output from the script comes as a notification on the bottom of the screen. The output gets truncated if long. To overcome the problem I used the following lines of code. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;```&lt;/P&gt;
&lt;P&gt;command_result = CommandResults(readable_output=text)&lt;BR /&gt;result = command_result.to_context()&lt;/P&gt;
&lt;P&gt;return_results(demisto.executeCommand('addEntries', {'id': '2528', 'entries': [result]}))&lt;/P&gt;
&lt;P&gt;```&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, the script isn't aware of the incident on which it has run so the id of the incident must be given manually. demisto.investigation() gave me the output below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;```&lt;SPAN class=""&gt;&lt;SPAN&gt;{ "cacheVersn": 0, "category": "", "closed": "0001-01-01T00:00:00Z", "created": "2022-12-23T11:56:03.467855667Z", "details": "", "entryUsers": null, "highPriority": false, "id": "d6b5abd0-f5dd-4715-85a0-fc5536d859e8", "isDebug": false, "lastOpen": "0001-01-01T00:00:00Z", "mirrorAutoClose": null, "mirrorTypes": null, "modified": "0001-01-01T00:00:00Z", "name": "Do Not Use Me", "rawCategory": "", "reason": null, "runStatus": "", "slackMirrorAutoClose": false, "slackMirrorType": "", "status": 0, "systems": null, "tags": null, "type": 0, "users": null, "version": 0 }&lt;/SPAN&gt;&lt;/SPAN&gt;```&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It clearly doesn't want me to use it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to return results to the current war room without having to specify the incident id manually?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Dec 2022 12:28:50 GMT</pubDate>
    <dc:creator>EnesOzdemir</dc:creator>
    <dc:date>2022-12-23T12:28:50Z</dc:date>
    <item>
      <title>Returning output from scripts that run on indicators to the war room</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/returning-output-from-scripts-that-run-on-indicators-to-the-war/m-p/524972#M1569</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am playing around with buttons on indicator layouts. The output from the script comes as a notification on the bottom of the screen. The output gets truncated if long. To overcome the problem I used the following lines of code. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;```&lt;/P&gt;
&lt;P&gt;command_result = CommandResults(readable_output=text)&lt;BR /&gt;result = command_result.to_context()&lt;/P&gt;
&lt;P&gt;return_results(demisto.executeCommand('addEntries', {'id': '2528', 'entries': [result]}))&lt;/P&gt;
&lt;P&gt;```&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, the script isn't aware of the incident on which it has run so the id of the incident must be given manually. demisto.investigation() gave me the output below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;```&lt;SPAN class=""&gt;&lt;SPAN&gt;{ "cacheVersn": 0, "category": "", "closed": "0001-01-01T00:00:00Z", "created": "2022-12-23T11:56:03.467855667Z", "details": "", "entryUsers": null, "highPriority": false, "id": "d6b5abd0-f5dd-4715-85a0-fc5536d859e8", "isDebug": false, "lastOpen": "0001-01-01T00:00:00Z", "mirrorAutoClose": null, "mirrorTypes": null, "modified": "0001-01-01T00:00:00Z", "name": "Do Not Use Me", "rawCategory": "", "reason": null, "runStatus": "", "slackMirrorAutoClose": false, "slackMirrorType": "", "status": 0, "systems": null, "tags": null, "type": 0, "users": null, "version": 0 }&lt;/SPAN&gt;&lt;/SPAN&gt;```&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It clearly doesn't want me to use it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to return results to the current war room without having to specify the incident id manually?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 12:28:50 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/returning-output-from-scripts-that-run-on-indicators-to-the-war/m-p/524972#M1569</guid>
      <dc:creator>EnesOzdemir</dc:creator>
      <dc:date>2022-12-23T12:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Returning output from scripts that run on indicators to the war room</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/returning-output-from-scripts-that-run-on-indicators-to-the-war/m-p/525316#M1574</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/204366"&gt;@EnesOzdemir&lt;/a&gt;, the buttons inside the indicator layout do not run on the incident hence you cannot see the ID. I would suggest using enhancement script. It would still use a button approach but you can reference the incident that it was called from. Refer -&lt;A href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/6.10/Cortex-XSOAR-Administrator-Guide/Enhancement-Scripts" target="_blank"&gt;https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/6.10/Cortex-XSOAR-Administrator-Guide/Enhancement-Scripts&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Screenshot of it working.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-12-28 at 2.55.05 pm.png" style="width: 999px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/46511i609D0A0E873D5884/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-12-28 at 2.55.05 pm.png" alt="Screen Shot 2022-12-28 at 2.55.05 pm.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 03:56:33 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/returning-output-from-scripts-that-run-on-indicators-to-the-war/m-p/525316#M1574</guid>
      <dc:creator>jfernandes1</dc:creator>
      <dc:date>2022-12-28T03:56:33Z</dc:date>
    </item>
  </channel>
</rss>

