<?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 ScriptA not calling ScriptB as expected in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/scripta-not-calling-scriptb-as-expected/m-p/474781#M675</link>
    <description>&lt;P&gt;I have some automation that I'm working on and I am not seeing the expected results.&amp;nbsp; I broke the script down into the following simple version.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ScriptA which is:&lt;/P&gt;&lt;P&gt;demisto.executeCommand("ScriptB", {})&lt;BR /&gt;&lt;BR /&gt;ScriptB which is:&lt;BR /&gt;return_results("ScriptB Called")&lt;BR /&gt;&lt;BR /&gt;when I run ScriptA, is there a reason ScriptB would not write to the war room?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Mar 2022 20:39:53 GMT</pubDate>
    <dc:creator>jboyd98</dc:creator>
    <dc:date>2022-03-21T20:39:53Z</dc:date>
    <item>
      <title>ScriptA not calling ScriptB as expected</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/scripta-not-calling-scriptb-as-expected/m-p/474781#M675</link>
      <description>&lt;P&gt;I have some automation that I'm working on and I am not seeing the expected results.&amp;nbsp; I broke the script down into the following simple version.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ScriptA which is:&lt;/P&gt;&lt;P&gt;demisto.executeCommand("ScriptB", {})&lt;BR /&gt;&lt;BR /&gt;ScriptB which is:&lt;BR /&gt;return_results("ScriptB Called")&lt;BR /&gt;&lt;BR /&gt;when I run ScriptA, is there a reason ScriptB would not write to the war room?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 20:39:53 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/scripta-not-calling-scriptb-as-expected/m-p/474781#M675</guid>
      <dc:creator>jboyd98</dc:creator>
      <dc:date>2022-03-21T20:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: ScriptA not calling ScriptB as expected</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/scripta-not-calling-scriptb-as-expected/m-p/474787#M676</link>
      <description>&lt;P&gt;The results of ScriptB are returned from the demisto.executeCommand function. To capture the output of ScriptB, ScriptA should look something like this:&lt;BR /&gt;&lt;BR /&gt;res = demisto.executeCommand("ScriptB", {})[0]["Contents"]&lt;BR /&gt;return_results(res)&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 20:49:20 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/scripta-not-calling-scriptb-as-expected/m-p/474787#M676</guid>
      <dc:creator>tyler_bailey</dc:creator>
      <dc:date>2022-03-21T20:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: ScriptA not calling ScriptB as expected</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/scripta-not-calling-scriptb-as-expected/m-p/474800#M677</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/201814"&gt;@tyler_bailey&lt;/a&gt;&amp;nbsp;That fixed the above.&lt;BR /&gt;&lt;BR /&gt;I used the above as a test, but really what I'm trying do is understand why the context data is not available in script B.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ScriptA which is:&lt;/P&gt;&lt;P&gt;return_results(demisto.incidents()[0])&amp;nbsp;&lt;/P&gt;&lt;P&gt;res = demisto.executeCommand('ScriptB', {})[0]["Contents"]&lt;BR /&gt;return_results(res)&lt;BR /&gt;&lt;BR /&gt;ScriptB which is:&lt;BR /&gt;return_results("ScriptB Called")&lt;/P&gt;&lt;P&gt;return_results(demisto.incidents()[0])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything is expected in War Room except my ScriptB "demisto.incidents()[0]" does not seem to be called or it's empty so it doesn't return anything to war room?&amp;nbsp; ScriptA incident data is returned in the war room as a json as expected.&lt;BR /&gt;&lt;BR /&gt;When ScriptB tries to reference the incident data its like it can't find it??&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Does that question make sense?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 21:17:15 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/scripta-not-calling-scriptb-as-expected/m-p/474800#M677</guid>
      <dc:creator>jboyd98</dc:creator>
      <dc:date>2022-03-21T21:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: ScriptA not calling ScriptB as expected</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/scripta-not-calling-scriptb-as-expected/m-p/474821#M678</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/208132"&gt;@jboyd98&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would just recommend removing the [0]['Contents'] on the end of executeCommand, and do return_results(str(res)) so that you can get an understanding of the entire entry structure. Since you have multiple return_results() in ScriptB, this means the second output would actually be under res[1]["Contents"].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps!&lt;/P&gt;
&lt;P&gt;-Lance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 00:00:14 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/scripta-not-calling-scriptb-as-expected/m-p/474821#M678</guid>
      <dc:creator>LancePettay</dc:creator>
      <dc:date>2022-03-22T00:00:14Z</dc:date>
    </item>
  </channel>
</rss>

