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

Fix is incident part of campaign bug #27787

Merged
merged 7 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Packs/Campaign/ReleaseNotes/3_3_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#### Scripts

##### IsIncidentPartOfCampaign

- Fixed an issue where the ***IsIncidentPartOfCampaign*** script failed when checking for a closed incident.
israelpoli marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ def check_incidents_ids_in_campaign(campaign_id: str, incidents_ids_set: Set[str
Returns:
True if at least one id from the incidents_ids_set is linked to the campaign incident, otherwise False.
"""
campaign_context = execute_command("getContext", {'id': campaign_id})['context']

connected_incidents_list = demisto.get(campaign_context, 'EmailCampaign.incidents')
if connected_incidents_list:
connected_campaign_incidents_ids = {incident.get('id') for incident in connected_incidents_list}
is_incidents_in_campaign = bool(incidents_ids_set & connected_campaign_incidents_ids)
if is_incidents_in_campaign:
return True

try:
campaign_context = execute_command("getContext", {'id': campaign_id})['context']

connected_incidents_list = demisto.get(campaign_context, 'EmailCampaign.incidents')
if connected_incidents_list:
israelpoli marked this conversation as resolved.
Show resolved Hide resolved
connected_campaign_incidents_ids = {incident.get('id') for incident in connected_incidents_list}
is_incidents_in_campaign = bool(incidents_ids_set & connected_campaign_incidents_ids)
if is_incidents_in_campaign:
return True
except Exception as e:
demisto.info(f"skipping for incident {campaign_id},\nThe reason: {e}")
israelpoli marked this conversation as resolved.
Show resolved Hide resolved
return False


Expand Down
2 changes: 1 addition & 1 deletion Packs/Campaign/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Phishing Campaign",
"description": "This pack can help you find related phishing, spam or other types of email incidents and characterize campaigns.",
"support": "xsoar",
"currentVersion": "3.3.1",
"currentVersion": "3.3.2",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down