<?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 Re: Create Incident layout fields from Context Data in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/create-incident-layout-fields-from-context-data/m-p/550895#M2392</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/282920"&gt;@szordominik&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;You can do this using dynamic sections. Please watch the below video to learn how dynamic sections work. There &lt;/SPAN&gt;&lt;SPAN&gt;is&lt;/SPAN&gt;&lt;SPAN&gt; also another one on Incident Layout.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;https&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;//&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="http://www.youtube.com" target="_blank" rel="noopener"&gt;www.youtube.com&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;watch&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;SPAN&gt;v&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;j3JRo5bgerU&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN&gt;t&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;482s&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;https&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;//&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="http://www.youtube.com" target="_blank" rel="noopener"&gt;www.youtube.com&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;watch&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;SPAN&gt;v&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;Ze_SI6axXj0&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;For your case something like below would &lt;/SPAN&gt;&lt;SPAN&gt;work&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;:&lt;BR /&gt;Note: please do not forget to tag the automation script as "dynamic-section"&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;LI-CODE lang="python"&gt;def main():
    try:
        incident = demisto.incidents()
        query = incident[0].get('id', {})
        context=demisto.executeCommand("getContext", {"id":query})[0].get("Contents").get("context").get(" Filtered_URL_List Context")
        header = 'URLs'
        command_results = CommandResults(readable_output=tableToMarkdown("URL Results", context, headers=header))
        return_results(command_results)
    except Exception as ex:
        return_error(f'Failed to execute the command. Error: {str(ex)}')


if __name__ in ('__main__', '__builtin__', 'builtins'):
    main()&lt;/LI-CODE&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gyldz_0-1690280798262.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/52117i0D57F182BF0486A9/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="gyldz_0-1690280798262.png" alt="gyldz_0-1690280798262.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Tue, 25 Jul 2023 10:26:45 GMT</pubDate>
    <dc:creator>gyldz</dc:creator>
    <dc:date>2023-07-25T10:26:45Z</dc:date>
    <item>
      <title>Create Incident layout fields from Context Data</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/create-incident-layout-fields-from-context-data/m-p/550850#M2391</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;During incident investigations, it would be useful if certain Context Data fields (if they have a value) are written to the incident layout and you don't have to search for the value in the Context.&lt;/P&gt;
&lt;P&gt;My question would be, how can I make it so that the contents of the context data fields associated with the incident are written to the incident layout?&lt;/P&gt;
&lt;P&gt;Example:&lt;BR /&gt;For a pishing incident I always want to see what URL values were. I need to filter the URL values by several criteria and I want to see the values of custom field e.g. Filtered_URL_List Context Data field on the incident layout.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 09:24:10 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/create-incident-layout-fields-from-context-data/m-p/550850#M2391</guid>
      <dc:creator>szordominik</dc:creator>
      <dc:date>2023-07-25T09:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create Incident layout fields from Context Data</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/create-incident-layout-fields-from-context-data/m-p/550895#M2392</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/282920"&gt;@szordominik&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;You can do this using dynamic sections. Please watch the below video to learn how dynamic sections work. There &lt;/SPAN&gt;&lt;SPAN&gt;is&lt;/SPAN&gt;&lt;SPAN&gt; also another one on Incident Layout.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;https&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;//&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="http://www.youtube.com" target="_blank" rel="noopener"&gt;www.youtube.com&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;watch&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;SPAN&gt;v&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;j3JRo5bgerU&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN&gt;t&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;482s&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;https&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;//&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="http://www.youtube.com" target="_blank" rel="noopener"&gt;www.youtube.com&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;watch&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;SPAN&gt;v&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;Ze_SI6axXj0&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;For your case something like below would &lt;/SPAN&gt;&lt;SPAN&gt;work&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;:&lt;BR /&gt;Note: please do not forget to tag the automation script as "dynamic-section"&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;LI-CODE lang="python"&gt;def main():
    try:
        incident = demisto.incidents()
        query = incident[0].get('id', {})
        context=demisto.executeCommand("getContext", {"id":query})[0].get("Contents").get("context").get(" Filtered_URL_List Context")
        header = 'URLs'
        command_results = CommandResults(readable_output=tableToMarkdown("URL Results", context, headers=header))
        return_results(command_results)
    except Exception as ex:
        return_error(f'Failed to execute the command. Error: {str(ex)}')


if __name__ in ('__main__', '__builtin__', 'builtins'):
    main()&lt;/LI-CODE&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gyldz_0-1690280798262.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/52117i0D57F182BF0486A9/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="gyldz_0-1690280798262.png" alt="gyldz_0-1690280798262.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Jul 2023 10:26:45 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/create-incident-layout-fields-from-context-data/m-p/550895#M2392</guid>
      <dc:creator>gyldz</dc:creator>
      <dc:date>2023-07-25T10:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create Incident layout fields from Context Data</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/create-incident-layout-fields-from-context-data/m-p/551299#M2410</link>
      <description>&lt;P&gt;Thank you!!!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I have one more question, can you give me an example of what the code would look like if I want the following format?&lt;BR /&gt;What I haven't been able to do yet is to create 2 columns in the same table format and the first column would contain the data type (burned in code) and the second column would contain the data itself (variable).&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;for example:&lt;BR /&gt;sender email address | abc@abc.com&lt;BR /&gt;some data type | data &lt;BR /&gt;etc..&lt;BR /&gt;&lt;BR /&gt;and what other formatting options are there besides tableToMarkdown? Can you help me with this for example by sending documentations?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 09:46:37 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/create-incident-layout-fields-from-context-data/m-p/551299#M2410</guid>
      <dc:creator>szordominik</dc:creator>
      <dc:date>2023-07-27T09:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Create Incident layout fields from Context Data</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/create-incident-layout-fields-from-context-data/m-p/551335#M2412</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can implement something like below&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;data = [{"type":"sender_address", "value":"abc@abc.com"},{"type":"IP", "value":"1.1.1.1"},{"type":"receipent", "value":"xyz@abc.com"}]

table_data = []

for item in data:
    table_data.append({
        'type': item['type'],
        'value': item['value']
    })

results= CommandResults(
    outputs_prefix='ExampleTable',
    # outputs={'TypeValueTable': table_data},
    readable_output=tableToMarkdown('Example Table', table_data))
return_results(results)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For CommandResults return capabilities you can check the below link:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://xsoar.pan.dev/docs/integrations/context-and-outputs" target="_blank"&gt;https://xsoar.pan.dev/docs/integrations/context-and-outputs&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 12:32:41 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/create-incident-layout-fields-from-context-data/m-p/551335#M2412</guid>
      <dc:creator>gyldz</dc:creator>
      <dc:date>2023-07-27T12:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: Create Incident layout fields from Context Data</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/create-incident-layout-fields-from-context-data/m-p/551756#M2431</link>
      <description>&lt;P&gt;Thank you!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;One last question.&lt;BR /&gt;How can I put clickable data/links on this &lt;SPAN&gt;dynamic sections&amp;nbsp;&lt;/SPAN&gt;layout field?&lt;/P&gt;
&lt;P&gt;When I open the Context Data database there all data can be copied by click + for example if I use a reputational 3rd party integration then the link to the generated file or url is also clickable/ or one click copyable. PL: Virustotal&lt;/P&gt;
&lt;P&gt;So the question would be how would you display the possibly multiple lines/ long links efficiently?&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 12:07:39 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/create-incident-layout-fields-from-context-data/m-p/551756#M2431</guid>
      <dc:creator>szordominik</dc:creator>
      <dc:date>2023-07-31T12:07:39Z</dc:date>
    </item>
  </channel>
</rss>

