Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XDR IR fix in close_xdr_incident error 500 #37246

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

noydavidi
Copy link
Contributor

@noydavidi noydavidi commented Nov 17, 2024

Status

  • In Progress
  • Ready
  • In Hold - (Reason for hold)

Related Issues

fixes: link to the issue

Description

Fixed an issue with outgoing mirroring when closing an incident in Cortex XSOAR with close_xdr_incident set to False resulted in a 500 error.
Fixed an issue with outgoing mirroring when closing an incident in Cortex XSOAR with close_xdr_incident set to False and close_alerts_in_xdr set to True resulted in an error.

Must have

  • Tests
  • Documentation

Copy link

github-actions bot commented Nov 17, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
Packs/CortexXDR/Integrations/CortexXDRIR
   CortexXDRIR.py6668886%60, 68, 72–74, 145–146, 207–211, 213, 216, 219, 223, 249–253, 255, 262–265, 276, 279, 282, 288, 291, 317, 322, 330, 332, 335–339, 341, 424–429, 478, 516, 531–532, 549, 559, 619, 622, 649, 656, 658, 735–736, 738, 791, 890–891, 989–991, 994, 997, 1002, 1056, 1082, 1115–1116, 1169, 1178, 1180–1182, 1185, 1188–1189, 1226–1229, 1261, 1278
TOTAL6668886% 

Tests Skipped Failures Errors Time
384 0 💤 0 ❌ 0 🔥 17.712s ⏱️

@ShirleyDenkberg
Copy link
Contributor

@maimorag @Shellyber Doc review completed.

changes from doc review

Co-authored-by: ShirleyDenkberg <[email protected]>
@@ -1041,7 +1041,10 @@ def update_remote_system_command(client, args):

if not close_xdr_incident and (update_args.get('status') in XSOAR_RESOLVED_STATUS_TO_XDR.values()):
status = update_args.pop('status')
demisto.debug(f"Popped {status=} from update_args, incident status won't be updated in XDR.")
resolve_comment = update_args.pop('resolve_comment', None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that the only field causing this issue is the resolve_comment?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this?

@ShirleyDenkberg
Copy link
Contributor

@noydavidi Doc reviewed again.

Copy link
Contributor

@Shellyber Shellyber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noce work

@@ -1041,7 +1041,10 @@ def update_remote_system_command(client, args):

if not close_xdr_incident and (update_args.get('status') in XSOAR_RESOLVED_STATUS_TO_XDR.values()):
status = update_args.pop('status')
demisto.debug(f"Popped {status=} from update_args, incident status won't be updated in XDR.")
resolve_comment = update_args.pop('resolve_comment', None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this?

if not close_xdr_incident and (update_args.get('status') in XSOAR_RESOLVED_STATUS_TO_XDR.values()):
status = update_args.pop('status')
demisto.debug(f"Popped {status=} from update_args, incident status won't be updated in XDR.")
popped_status = update_args.pop('status')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change the terminology back to status, and add maybe a comment for the if statement so it will be clear what it does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants