<?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 Playbook task naming in subplaybooks in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/512448#M1124</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't find much data on Subplaybook naming numbers - how are they being assign and when do they change?&lt;/P&gt;
&lt;P&gt;I've run into the following issue: i had a standalone playbook with some subplaybooks inside. In the main playbook I've been referring to the results of the subplaybooks by e.g. subplaybook-167.something. It worked fine until I started to use the main playbook as a subplaybook of other playbook. I noticed then that the subplaybook name numbers in the new playbook are different and that kills my logic, e.g. subplaybook-167 became subplaybook-54. What is the best approach to overcome this? Is there a way to hard code subplaybook name and refer to it regardless of whether it is run as standalone or part of other playbook?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Antanas&lt;/P&gt;</description>
    <pubDate>Sun, 21 Aug 2022 11:11:02 GMT</pubDate>
    <dc:creator>Antanas</dc:creator>
    <dc:date>2022-08-21T11:11:02Z</dc:date>
    <item>
      <title>Playbook task naming in subplaybooks</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/512448#M1124</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't find much data on Subplaybook naming numbers - how are they being assign and when do they change?&lt;/P&gt;
&lt;P&gt;I've run into the following issue: i had a standalone playbook with some subplaybooks inside. In the main playbook I've been referring to the results of the subplaybooks by e.g. subplaybook-167.something. It worked fine until I started to use the main playbook as a subplaybook of other playbook. I noticed then that the subplaybook name numbers in the new playbook are different and that kills my logic, e.g. subplaybook-167 became subplaybook-54. What is the best approach to overcome this? Is there a way to hard code subplaybook name and refer to it regardless of whether it is run as standalone or part of other playbook?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Antanas&lt;/P&gt;</description>
      <pubDate>Sun, 21 Aug 2022 11:11:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/512448#M1124</guid>
      <dc:creator>Antanas</dc:creator>
      <dc:date>2022-08-21T11:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Playbook task naming in subplaybooks</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/512449#M1125</link>
      <description>&lt;P&gt;Hey &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/218893"&gt;@Antanas&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The sub-playbook number usually represents the sub-playbook task ID in its' parent playbook. So theoretically it should stay the same as long as no other changes are made to it that change the task's number (like in your example, adding the parent playbook to be a sub-playbook in another playbook).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&lt;SPAN&gt;However, the above logic isn't 100% guaranteed, and can be different in some cases - so I would highly advise avoiding relying on this numbering. Instead, you can&amp;nbsp;use the &lt;A href="https://docs.paloaltonetworks.com/cortex/cortex-xsoar/6-9/cortex-xsoar-admin/playbooks/playbook-inputs-and-outputs" target="_blank" rel="noopener"&gt;playbook outputs&lt;/A&gt; parameters so you won't have to use the&amp;nbsp;&lt;CODE class="" data-stringify-type="code"&gt;subplaybook-xx&lt;/CODE&gt;&lt;/SPAN&gt;&amp;nbsp;context path when needing to refer to any data saved in that sub-playbook.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I don't know what's your use case here, but was there any specific issue or reason you chose using subplaybook-167 instead of the playbook outputs?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://docs.paloaltonetworks.com/cortex/cortex-xsoar/6-9/cortex-xsoar-admin/playbooks/playbook-inputs-and-outputs" target="_blank" rel="noopener"&gt;&lt;CODE class="" data-stringify-type="code"&gt;&lt;/CODE&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Aug 2022 12:51:49 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/512449#M1125</guid>
      <dc:creator>nkazinets</dc:creator>
      <dc:date>2022-08-21T12:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Playbook task naming in subplaybooks</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/512501#M1128</link>
      <description>&lt;P&gt;Thank you for your answer&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/221672"&gt;@nkazinets&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason I'm using subplaybook numbers is that I saw this commonly used by Palo Alto PS guys who inititially developed the playbooks in our environment. I understand the workaround now and will rebuild the ones in question.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again,&lt;/P&gt;
&lt;P&gt;Antanas&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 07:05:13 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/512501#M1128</guid>
      <dc:creator>Antanas</dc:creator>
      <dc:date>2022-08-22T07:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Playbook task naming in subplaybooks</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/512631#M1129</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/218893"&gt;@Antanas&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the key&amp;nbsp;${currentPlaybookID} in the sub-playbook to grab the id of the playbook task. You can send this back to the parent playbooks as an output if you need to re-use it later. Refer to the screenshot below.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-08-23 at 10.51.58 am.png" style="width: 412px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/43294iD0D4984B519D4257/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-08-23 at 10.51.58 am.png" alt="Screen Shot 2022-08-23 at 10.51.58 am.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 00:53:01 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/512631#M1129</guid>
      <dc:creator>jfernandes1</dc:creator>
      <dc:date>2022-08-23T00:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Playbook task naming in subplaybooks</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/512972#M1137</link>
      <description>&lt;P&gt;Hi &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/208028"&gt;@jfernandes1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is very promising. I encountered one issue though. I managed to dynamically set a full subplaybook name which is stored on a key. However when I try to pass the value of that key into a function that requires an array - it fails.&lt;/P&gt;
&lt;P&gt;E.g. I have set a key SubplaybookKey which after execution is dynamically set to "&lt;SPAN&gt;subplaybook-28.LogRhythm.Search.Results"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;When I pass the&amp;nbsp;SubplaybookKey into ExportToCsv automation that requires an array - it fails as it literarily&amp;nbsp;receives string "subplaybook-28.LogRhythm.Search.Results". Is there an easy way to force this value to be treated as the data behind the key?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Antanas&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 10:45:49 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/512972#M1137</guid>
      <dc:creator>Antanas</dc:creator>
      <dc:date>2022-08-25T10:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Playbook task naming in subplaybooks</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/512974#M1138</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/218893"&gt;@Antanas&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How are you passing the&amp;nbsp;&lt;SPAN&gt;SubplaybookKey to the export command?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;When using a context key with the intent of getting the data behind the key, we need to wrap it with ${} - this will get the data, instead of the key name (which is useful in other scenarios)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So in your case, the command would look like so:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;!ExportToCSV csvArray=${subplaybook-28.LogRhythm.Search.Results} fileName=test.csv&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Aug 2022 10:54:47 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/512974#M1138</guid>
      <dc:creator>nkazinets</dc:creator>
      <dc:date>2022-08-25T10:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Playbook task naming in subplaybooks</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/513218#M1141</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/221672"&gt;@nkazinets&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue is that i do not know the subplaybook name beforehand. The name is dynamically built during execution and is stored under the key&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;SubplaybookKey. &lt;/STRONG&gt;If I try something like that - it wouldnt work:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;!ExportToCSV csvArray=${${SubplaybookKey}} fileName=test.csv
&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 29 Aug 2022 06:26:00 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/513218#M1141</guid>
      <dc:creator>Antanas</dc:creator>
      <dc:date>2022-08-29T06:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Playbook task naming in subplaybooks</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/513411#M1144</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/218893"&gt;@Antanas&lt;/a&gt;, that's an excellent question. In my particular use case, I passed the collected playbook IDs to the deleteContext command. This command only required the keys to be specified. Your use case requires "double replacement".&lt;/P&gt;
&lt;P&gt;1. Replace with the dynamic sub-playbook IDs&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Replace with the key value&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think this is possible without a custom automation. It would be fairly simple though. I've written some code below to help with this. You can perform the first replacement while passing the value to the command. The automation will perform the second replacement.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;data = demisto.args()['key']
incident  = demisto.incidents()[0]
incident.update(demisto.context())
if not incident.get(data):
    return_error("Key not found")
else:
    demisto.results(incident.get(data))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-08-31 at 10.38.23 am.png" style="width: 306px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/43449iAB04E8D9923ABB7A/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-08-31 at 10.38.23 am.png" alt="Screen Shot 2022-08-31 at 10.38.23 am.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2022 00:41:36 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/playbook-task-naming-in-subplaybooks/m-p/513411#M1144</guid>
      <dc:creator>jfernandes1</dc:creator>
      <dc:date>2022-08-31T00:41:36Z</dc:date>
    </item>
  </channel>
</rss>

