Skip to content

Commit

Permalink
hide events and assets in XSOAR machines (#4160)
Browse files Browse the repository at this point in the history
* enhancements

* edit

* removed comments

* edits

* edit

* edit
  • Loading branch information
merit-maita authored Mar 27, 2024
1 parent 59f1a47 commit 76c5af2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .changelog/4160.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- description: Fixes an issue where *Fetch Events* and *Fetch Assets* checkboxes appeared in Xsoar Machines.
type: fix
pr_number: 4160
14 changes: 13 additions & 1 deletion demisto_sdk/commands/content_graph/objects/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def to_raw_dict(self) -> Dict:
class Integration(IntegrationScript, content_type=ContentType.INTEGRATION): # type: ignore[call-arg]
is_fetch: bool = Field(False, alias="isfetch")
is_fetch_events: bool = Field(False, alias="isfetchevents")
is_fetch_assets: bool = False
is_fetch_assets: bool = Field(False, alias="isfetchassets")
is_fetch_events_and_assets: bool = False
is_feed: bool = False
is_beta: bool = False
Expand Down Expand Up @@ -137,6 +137,11 @@ def summary(
incident_to_alert: bool = False,
) -> dict:
summary = super().summary(marketplace, incident_to_alert)
if marketplace != MarketplaceVersions.MarketplaceV2:
if summary.get("isfetchevents"):
summary["isfetchevents"] = False
if summary.get("isfetchassets"):
summary["isfetchassets"] = False
if self.unified_data:
summary["name"] = self.unified_data.get("display")
return summary
Expand All @@ -153,6 +158,7 @@ def metadata_fields(self):
}, # for all commands, keep the name and description
"is_fetch": True,
"is_fetch_events": True,
"is_fetch_assets": True,
}
)
)
Expand All @@ -163,6 +169,12 @@ def prepare_for_upload(
**kwargs,
) -> dict:
data = super().prepare_for_upload(current_marketplace, **kwargs)
if current_marketplace != MarketplaceVersions.MarketplaceV2:
script: dict = data.get("script", {})
if script.get("isfetchevents"):
data["script"]["isfetchevents"] = False
if script.get("isfetchassets"):
data["script"]["isfetchassets"] = False

if supported_native_images := self.get_supported_native_images(
ignore_native_image=kwargs.get("ignore_native_image") or False,
Expand Down

0 comments on commit 76c5af2

Please sign in to comment.