<?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 Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15) in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/389281#M158</link>
    <description>&lt;P&gt;I have a trigger script automation that updates the linked incidents of an incident.&amp;nbsp; The update works, but then it produces the following error and refuses to update the field that triggered the automation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DZerkle_0-1614912375236.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/30196iD5BCA0150F9B4F8E/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="DZerkle_0-1614912375236.png" alt="DZerkle_0-1614912375236.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script works fine if I run it from the command line.&amp;nbsp; It's only when a triggered script runs that there's a problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a sample that causes a problem.&amp;nbsp; If I comment this line out, the field updates just fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;demisto.executeCommand("setIncident", {'id':child_case_id, "customFields":"{\"False Positive\":\"True\"}"})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Anyone know what's going on and to fix this?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Mar 2021 03:08:55 GMT</pubDate>
    <dc:creator>DZerkle</dc:creator>
    <dc:date>2021-03-05T03:08:55Z</dc:date>
    <item>
      <title>Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/389281#M158</link>
      <description>&lt;P&gt;I have a trigger script automation that updates the linked incidents of an incident.&amp;nbsp; The update works, but then it produces the following error and refuses to update the field that triggered the automation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DZerkle_0-1614912375236.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/30196iD5BCA0150F9B4F8E/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="DZerkle_0-1614912375236.png" alt="DZerkle_0-1614912375236.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script works fine if I run it from the command line.&amp;nbsp; It's only when a triggered script runs that there's a problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a sample that causes a problem.&amp;nbsp; If I comment this line out, the field updates just fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;demisto.executeCommand("setIncident", {'id':child_case_id, "customFields":"{\"False Positive\":\"True\"}"})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Anyone know what's going on and to fix this?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 03:08:55 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/389281#M158</guid>
      <dc:creator>DZerkle</dc:creator>
      <dc:date>2021-03-05T03:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/389334#M159</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume this a field-change-triggered script? What do you have selected for the ""Run triggered script after incident is modified"?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ABurt_0-1614937584774.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/30199i3FD16184567B52BE/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="ABurt_0-1614937584774.png" alt="ABurt_0-1614937584774.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will not need to specify the "CustomFields" in the setIncident command either. You can use the system name for the field. In your case it would (most likely) be:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;demisto.executeCommand("setIncident", {"id":child_case_id, "falsepositive":True})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Adam&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 10:02:45 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/389334#M159</guid>
      <dc:creator>ABurt</dc:creator>
      <dc:date>2021-03-05T10:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/389422#M160</link>
      <description>&lt;P&gt;I don't even have that checkbox.&amp;nbsp; Where is it?&amp;nbsp; We're running 6.0.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DZerkle_0-1614958757707.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/30205i249F50A6706083AA/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="DZerkle_0-1614958757707.png" alt="DZerkle_0-1614958757707.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 15:40:08 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/389422#M160</guid>
      <dc:creator>DZerkle</dc:creator>
      <dc:date>2021-03-05T15:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/389463#M161</link>
      <description>&lt;P&gt;It looks like the checkbox is only there for version 6.1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The workaround is to leave&amp;nbsp;&lt;SPAN&gt;out the&amp;nbsp;&lt;/SPAN&gt;'id':child_case_id&lt;SPAN&gt;&amp;nbsp; in the setIncident command and leave out the&amp;nbsp;&lt;/SPAN&gt;"incidentId":child_case_id&lt;SPAN&gt;&amp;nbsp; in the linkIncidents command&lt;/SPAN&gt;&lt;SPAN&gt;.&amp;nbsp; This will default to using the current incident.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It may be that you have to use the ID, as is the case with the linkIncidents command.&amp;nbsp;&amp;nbsp;In this case, triggered scripts need to use&amp;nbsp;demisto.investigation()['id'] to get the incident ID.&amp;nbsp; They can't use&amp;nbsp;demisto.incidents()[0]['id'].&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 16:28:50 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/389463#M161</guid>
      <dc:creator>DZerkle</dc:creator>
      <dc:date>2021-03-22T16:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/389509#M164</link>
      <description>&lt;P&gt;The solution above turns out to be only partial.&amp;nbsp; Leaving out the incidentId field for the linkIncidents command causes the command to do nothing.&amp;nbsp; Putting it back in re-generates the DB version errors.&amp;nbsp; Running the trigger script from the command line works perfectly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I don't have a way to modify linked cases in a triggered script in 6.0.&amp;nbsp; Anyone know?&lt;/P&gt;</description>
      <pubDate>Sat, 06 Mar 2021 00:54:14 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/389509#M164</guid>
      <dc:creator>DZerkle</dc:creator>
      <dc:date>2021-03-06T00:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/389677#M166</link>
      <description>&lt;P&gt;If you leave out the "id" field in the setIncident command, it will execute within the current incident (it assumes the current incident is the id).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is the script executing from within an existing incident, or is the script attemping to update a different incident?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 08:58:57 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/389677#M166</guid>
      <dc:creator>ABurt</dc:creator>
      <dc:date>2021-03-08T08:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/391650#M172</link>
      <description>&lt;P&gt;We just upgraded to 6.1, so I revisited this matter.&amp;nbsp; It's not much better.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DB Version errors no longer appear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I leave "Run triggered script after case is modified" unchecked, the triggered script correctly updates other fields with the setIncident command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I check that box, the other fields do not update, even though the war room says that they're updated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Whether I check that box or not, and no matter how it is called, the linkIncidents command does nothing when run from a triggered script.&amp;nbsp; It works as expected if run from a script launched by a button or the command line.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you confirm the above?&amp;nbsp; &lt;A href="https://docs.paloaltonetworks.com/cortex/cortex-xsoar/6-1/cortex-xsoar-admin/incidents/incidents-management/incident-fields/field-trigger-scripts.html" target="_self"&gt;The docs&lt;/A&gt; mention nothing about linking incidents from triggered scripts.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 01:03:26 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/391650#M172</guid>
      <dc:creator>DZerkle</dc:creator>
      <dc:date>2021-03-17T01:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/391677#M173</link>
      <description>&lt;P&gt;The automatoin script that you have created to link the incidents, can you confirm who it is running as? By default it's "limited user".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This may be affecting the outcome.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 10:03:49 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/391677#M173</guid>
      <dc:creator>ABurt</dc:creator>
      <dc:date>2021-03-17T10:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/391773#M174</link>
      <description>&lt;P&gt;It was set to "limited user".&amp;nbsp; I tried setting it to "DBot".&amp;nbsp; No change in behavior resulted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the exact same script triggered by a button and triggered by a field change.&amp;nbsp; It works fine when triggered by the button.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 16:22:14 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/391773#M174</guid>
      <dc:creator>DZerkle</dc:creator>
      <dc:date>2021-03-17T16:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/391795#M175</link>
      <description>&lt;P&gt;Can you post the contents of the script?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 16:46:53 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/391795#M175</guid>
      <dc:creator>ABurt</dc:creator>
      <dc:date>2021-03-17T16:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/391810#M176</link>
      <description>&lt;P&gt;The script is pretty unremarkable, except that it's called by a wrapper script that processes the "new" argument.&amp;nbsp; The same wrapper is attached to the (correctly working) button, which fills the "new" argument with the field value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The behavior is consistently reproducible.&amp;nbsp; At this point, I'm looking for confirmation:&amp;nbsp; Is it expected behavior that scripts triggered by a field change can't modify linked cases?&amp;nbsp; If so, a documentation update and feature idea would be in order.&amp;nbsp; If not, a bug fix is in order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course, if you have a workaround better than "Use a button to trigger the script", that would be great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;incident = demisto.incidents()[0]

new_parent_case_id = demisto.args()["parent"]
child_case_id = demisto.args().get("child", "")
if child_case_id == "":
    child_case_id = incident.get("id", "Error")

# Remove any existing links on the child (current) case
old_linked_incidents_list = incident.get('linkedIncidents', [])
if old_linked_incidents_list:
    old_linked_incidents = ",".join(old_linked_incidents_list)
    # This line does nothing when this script is triggered by a field change
    # It works fine when this script is triggered by a button
    # Removing the "incidentId" argument changes nothing
    # Changing the "run as" parameter to DBot changes nothing
    demisto.executeCommand("linkIncidents", {"incidentId":child_case_id, "linkedIncidentIDs":old_linked_incidents, "action": "unlink"})

# Create new false positive parent, if requested
if new_parent_case_id == "Create":
    parent_name = "PARENT: " + demisto.incidents()[0]['name']
    resp = demisto.executeCommand("createNewCase", {
        "name": parent_name,
        "type": "False Positive Parent",
        "severity": "low",
        "roles": "##Redacted##"
    })

    if isError(resp[0]):
        demisto.results('Error while creating the new false positive parent case: ' + str(resp))
        sys.exit(0)

    new_parent_case_id = None
    if (resp[0] and resp[0]["EntryContext"] and 'CreatedIncidentID' in resp[0]["EntryContext"] ):
        new_parent_case_id = resp[0]["EntryContext"]['CreatedIncidentID']
    else:
        demisto.results(f'Failed to find the new incident id from create case request')

    # Update the False Postive Parent field to show the new parent
    # Note that this may trigger a field-change script, so it's important to avoid looping around
    # However, the problem with the linked incidents happens even when this branch of code is not executed
    resp = demisto.executeCommand('setIncident', {
            'falsepositiveparent': "{} {}".format(new_parent_case_id, parent_name)
    })

# Link to the False Positive Parent
if new_parent_case_id != "None":
    # Link to the parent case
    # This line does nothing then this script is triggered by a field change
    demisto.executeCommand('linkIncidents', {"incidentId":child_case_id, "linkedIncidentIDs":new_parent_case_id})

    # Mark the child case as a stalled false positive
    # This line works fine when this script is triggered by a field change
    resp = demisto.executeCommand('setIncident', {
            'id': child_case_id,
            'stalled': True,
            'falsepositive': True
    })
    if isError(resp[0]):
        demisto.results('Failed updating existing case with false positive attributes: ' + str(resp))
        sys.exit(0)

demisto.results("Attempted to attach child false positive case {} to parent case {}".format(child_case_id, new_parent_case_id))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the wrapper:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;new_field_value = demisto.args()["new"]

new_parent_case_id = new_field_value.split(" ")[0]

# Execute the update
demisto.executeCommand("AddChildToParent", {"parent":new_parent_case_id})
demisto.results("Attempted to attach child false positive case to parent case {}".format(new_parent_case_id))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 17:19:07 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/391810#M176</guid>
      <dc:creator>DZerkle</dc:creator>
      <dc:date>2021-03-17T17:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/392721#M177</link>
      <description>&lt;P&gt;Hi! Sorry for teh long delay.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can carry out the whole process using a single drop down menu:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6242691069001w600h227r679" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6242691069001" data-account="6058004142001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6058004142001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6242691069001w600h227r679');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://live.paloaltonetworks.com/t5/video/gallerypage/video-id/6242691069001"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had created:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;A field named "&lt;SPAN&gt;False Positive Parent"&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;The field was a "single select" field with the values: "None,Create New..."&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;It is set to "Run triggered script after incident is modified"&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;It has a script a field display script called "populateParent" (described below)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;It has a field value change script called "setLinkedIncident" (described below)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"populateParent" is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;args = demisto.args()
field = args.get('field', {})
options = field.get('selectValues', [])
all_incidents = [f"{x['name']} - {x['id']}" for x in demisto.executeCommand("getIncidents", {"query": "-status:Closed and type:\"False Positive Parent\""})[0]['Contents']['data']] + options
demisto.results({"hidden": False, "options": all_incidents})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"setLinkedIncident" is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;args = demisto.args()
new = args.get('new', None)
old = args.get('old', None)
incident = demisto.incident()
incident_id = incident.get('investigationId')
incident_name = incident.get('name', '')
custom_fields = incident.get('CustomFields', {})
linked_incidents = incident.get('linkedIncidents', [])


# Remove existing linked incidents0
if new == "None" or old != "None" and linked_incidents:
    demisto.executeCommand("linkIncidents", {"incidentId": incident_id, "linkedIncidentIDs": ",".join(linked_incidents), "action": "unlink"})

# If the user requested a new case:
if new == "Create New..." or new != "None":

    if new == "Create New...":
        new_incident = demisto.executeCommand("createNewIncident", {
            "name": f"PARENT: {incident_name}",
            "type": "False Positive Parent",
            "severity": 1
        })[0]['EntryContext']
        new_incident = new_incident.get('CreatedIncidentID', None)
        demisto.executeCommand("linkIncidents", {"incidentId": incident_id, "linkedIncidentIDs": new_incident, "action": "link"})
        new = new_incident
        demisto.executeCommand("setIncident", {"falsepositiveparent": f"PARENT: {incident_name} - {new_incident}"})
        new = new_incident
        return_results(new)
    elif new != "None":
        new = new.split(" - ")[1]
        demisto.executeCommand("linkIncidents", {"incidentId": incident_id, "linkedIncidentIDs": new, "action": "link"})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above script doesn't contain items such as "closeInvestigation", but could easily include them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I DO have trouble when using the "Create New..." option. It will create the new incident and assign it, but it won't assign the new value to the field. It has to be assigned manually again. I would suggest having a separate button that is purely used for creating a new incident, perhaps with a few more fields in there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I can link incidents using the dropdown. I think the key here is to link the current incident to the remote incident, not the other way around.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 15:49:38 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/392721#M177</guid>
      <dc:creator>ABurt</dc:creator>
      <dc:date>2021-03-22T15:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/392731#M178</link>
      <description>&lt;P&gt;Another complication is that triggered scripts need to use&amp;nbsp;demisto.investigation()['id'] to get the incident ID.&amp;nbsp; They can't use&amp;nbsp;demisto.incidents()[0]['id'].&amp;nbsp; I was able to use that ID to get linkIncidents to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current problem is using setIncident to update fields from a trigger script.&amp;nbsp; It's fine if the user modifies the field via the GUI, but if a button script modifies the field, then the trigger script locks up when it tries to update an additional field with setIncident.&amp;nbsp; The script just hangs.&amp;nbsp; At that point, the incident is locked up, and it's not even possible to close it.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 16:40:47 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/392731#M178</guid>
      <dc:creator>DZerkle</dc:creator>
      <dc:date>2021-03-22T16:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/392784#M179</link>
      <description>&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6242721622001w1400h529r227" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6242721622001" data-account="6058004142001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6058004142001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6242721622001w1400h529r227');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://live.paloaltonetworks.com/t5/video/gallerypage/video-id/6242721622001"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the above video I used the following scripts:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;False Positive Parent - Field (single select with values "None,Create New...")&lt;/LI&gt;&lt;LI&gt;Field Display Script set as "populateParent"&lt;/LI&gt;&lt;LI&gt;Field Change Script (Run triggered script after incident is modified) as "setLinkedIncident"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"populateParent":&lt;/P&gt;&lt;LI-CODE lang="python"&gt;args = demisto.args()
field = args.get('field', {})
options = field.get('selectValues', [])
all_incidents = [f"{x['name']} - {x['id']}" for x in demisto.executeCommand("getIncidents", {"query": "-status:Closed and type:\"False Positive Parent\""})[0]['Contents']['data']] + options
demisto.results({"hidden": False, "options": all_incidents})&lt;/LI-CODE&gt;&lt;P&gt;(Adjust query as you see fit)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"setLinkedIncident":&lt;/P&gt;&lt;LI-CODE lang="python"&gt;args = demisto.args()
new = args.get('new', None)
old = args.get('old', None)
incident = demisto.incident()
incident_id = incident.get('investigationId')
incident_name = incident.get('name', '')
custom_fields = incident.get('CustomFields', {})
linked_incidents = incident.get('linkedIncidents', [])
should_close = False
parent_incident = None

# Remove existing linked incidents0
if new == "None" or old != "None" and linked_incidents:
    demisto.executeCommand("linkIncidents", {"incidentId": incident_id, "linkedIncidentIDs": ",".join(linked_incidents), "action": "unlink"})

    if new == "None":
        demisto.executeCommand("setIncident", {"closeNotes": "''", "closeReason": "''"})

# If the user requested a new case:
if new == "Create New..." or new != "None":

    if new == "Create New...":
        new_incident = demisto.executeCommand("createNewIncident", {
            "name": f"PARENT: {incident_name}",
            "type": "False Positive Parent",
            "severity": 1
        })[0]['EntryContext']
        new_incident = new_incident.get('CreatedIncidentID', None)
        demisto.executeCommand("linkIncidents", {"incidentId": incident_id, "linkedIncidentIDs": new_incident, "action": "link"})
        parent_incident = new_incident
        shoudl_close = True
    elif new != "None":
        new = new.split(" - ")[1]
        parent_incident = new
        should_close = True
        demisto.executeCommand("linkIncidents", {"incidentId": incident_id, "linkedIncidentIDs": new, "action": "link"})

if should_close:
    demisto.executeCommand("closeInvestigation", {"closeNotes": f"Parent incident {parent_incident}", "closeReason": "Duplicate"})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "Create New..." I can't seem to create the incident AND set the field at the same time. I would suggest a separate button to create a new parent incident. This could then have more properties the user could manage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 17:59:44 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/392784#M179</guid>
      <dc:creator>ABurt</dc:creator>
      <dc:date>2021-03-22T17:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/392785#M180</link>
      <description>&lt;P&gt;This is not usual behaviour and indicates that something maybe sat in a loop in teh script somewhere.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you try and set a small timeout for the script (around 5 seconds) and see if the incident locks up for that 5 secs. If so, there is something not executing correctly in the script.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 18:01:53 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/392785#M180</guid>
      <dc:creator>ABurt</dc:creator>
      <dc:date>2021-03-22T18:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/393139#M189</link>
      <description>&lt;P&gt;Yes, I created a new button for the "Create new parent" thing.&amp;nbsp; I tried to do it via the triggered script.&amp;nbsp; I could get it to link to create the new incident and to link to it (using demisto.investigation()['id']).&amp;nbsp; However, that would require updating the field that just got changed from "Create new..." to the name of the new parent, and I couldn't get that to work.&amp;nbsp; That's when I gave up and made the button.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You suggest a delay.&amp;nbsp; I'm not sure where you want me to put it.&amp;nbsp; Here's the current sequence.&amp;nbsp; Where should I put it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;User clicks button&lt;/LI&gt;&lt;LI&gt;The button graphic changes to a swirly circle&lt;/LI&gt;&lt;LI&gt;Button script creates new parent incident&lt;/LI&gt;&lt;LI&gt;Button script calls setIncident to successfully update falsepositiveparent field with the name of the new incident&lt;/LI&gt;&lt;LI&gt;The trigger script for the falsepositiveparent field activates&lt;/LI&gt;&lt;LI&gt;The trigger script computes its own ID using demisto.investigation()["id"].&lt;/LI&gt;&lt;LI&gt;The trigger script (using that ID) successfully unlinks any old incidents and links to the new parent.&lt;/LI&gt;&lt;LI&gt;The trigger script attempts to update the falsepositive boolean field using setIncident, but hangs, instead, and never finishes.&lt;/LI&gt;&lt;LI&gt;The button graphic stays a swirly circle forever.&lt;/LI&gt;&lt;LI&gt;I attempt to close the case manually, filling in required fields for the pop-up form.&amp;nbsp; I get no errors.&lt;/LI&gt;&lt;LI&gt;The case stays open forever.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If steps 1-4 are replaced by a user clicking on the falsepositiveparent field to update it, everything works perfectly.&amp;nbsp; So, this smells like a deadly embrace bug where the button and the trigger script are waiting for each other.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that there are no loops.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The workaround is just to stop trying to update the falsepositive field and make the user do it manually.&amp;nbsp; That's not a huge problem, so don't break your back trying to figure this out in a rush.&amp;nbsp; It's worth figuring out eventually, though, as the documentation for the restrictions on trigger scripts should be more complete, and also this might be an actual bug.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 00:25:12 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/393139#M189</guid>
      <dc:creator>DZerkle</dc:creator>
      <dc:date>2021-03-24T00:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/393140#M190</link>
      <description>&lt;P&gt;Also, I'm very impressed that your triggered script in the video managed to close the incident.&amp;nbsp; On reading the&lt;A href="https://docs.paloaltonetworks.com/cortex/cortex-xsoar/6-1/cortex-xsoar-admin/incidents/incidents-management/incident-fields/field-trigger-scripts.html" target="_self"&gt; documentation for trigger scripts&lt;/A&gt;, I see that "&lt;SPAN&gt;Trigger scripts cannot close incidents.".&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 00:38:26 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/393140#M190</guid>
      <dc:creator>DZerkle</dc:creator>
      <dc:date>2021-03-24T00:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/393236#M191</link>
      <description>&lt;P&gt;Sorry, I did not meana delay in the script iteself. I meant the timeout of the script:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ABurt_0-1616587479981.png" style="width: 999px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/30514iD1BF4CC1F07AE9FD/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="ABurt_0-1616587479981.png" alt="ABurt_0-1616587479981.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there is something "locking up" the incident in the script, then it will unlock after (for example) 5 seconds.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 12:05:12 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/393236#M191</guid>
      <dc:creator>ABurt</dc:creator>
      <dc:date>2021-03-24T12:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/393245#M192</link>
      <description>&lt;P&gt;Ha, I did not notice that in the documentation. I have informed our technical writers about it and they will check with engineering before updating the docs. Well spotted!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 12:05:56 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/393245#M192</guid>
      <dc:creator>ABurt</dc:creator>
      <dc:date>2021-03-24T12:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Error:  DB Version '##' and Insert version '##' do not match for id: ##### on bucket [] [incidents] (15)</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/393666#M195</link>
      <description>&lt;P&gt;The timeouts for all the scripts are set to the default, 180 seconds.&amp;nbsp; The lockup seems to be forever.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've asked our admin to file a support ticket to get help closing the broken incidents.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 23:55:36 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/error-db-version-and-insert-version-do-not-match-for-id-on/m-p/393666#M195</guid>
      <dc:creator>DZerkle</dc:creator>
      <dc:date>2021-03-24T23:55:36Z</dc:date>
    </item>
  </channel>
</rss>

