Skip to content

Conversation

@dianagrecu-uipath
Copy link
Contributor

@dianagrecu-uipath dianagrecu-uipath commented Jan 5, 2026

Description

Add support for Asset Recipient in Escalations

Testing

Locally and added unit tests

Comment on lines 36 to 45
if (
recipient.type == AgentEscalationRecipientType.ASSET_USER_EMAIL
or recipient.type == AgentEscalationRecipientType.ASSET_GROUP_NAME
):
return resolve_asset(recipient.asset_name, recipient.folder_path)

if hasattr(recipient, "value"):
return recipient.value

return None
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's use type narrowing here as AgentEscalationRecipient is a discriminated union and can be used specifically for such scenarios.

Suggested change
if (
recipient.type == AgentEscalationRecipientType.ASSET_USER_EMAIL
or recipient.type == AgentEscalationRecipientType.ASSET_GROUP_NAME
):
return resolve_asset(recipient.asset_name, recipient.folder_path)
if hasattr(recipient, "value"):
return recipient.value
return None
if isinstance(recipient, AssetRecipient):
return resolve_asset(recipient.asset_name, recipient.folder_path)
if isinstance(recipient, StandardRecipient):
return recipient.value
return None

"""Retrieve asset value."""
try:
client = UiPath()
result = client.assets.retrieve(name=asset_name, folder_path=folder_path)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see the assets client also has an retrieve_async which we should use: https://github.com/UiPath/uipath-python/blob/main/src/uipath/platform/orchestrator/_assets_service.py#L84

@cotovanu-cristian cotovanu-cristian merged commit 9265a24 into main Jan 6, 2026
39 checks passed
@cotovanu-cristian cotovanu-cristian deleted the feat/asset-recipient branch January 6, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants