@@ -359,9 +359,14 @@ def test_workflow_notification(user, account_id, workflow, message_type):
359
359
playbook_execution = playbook_executions .first ()
360
360
pe_proto : PlaybookExecution = playbook_execution .proto
361
361
p_proto = pe_proto .playbook
362
- playbook_url = build_absolute_uri (None , settings .PLATFORM_PLAYBOOKS_PAGE_LOCATION .format (p_proto .id .value ),
363
- settings .PLATFORM_PLAYBOOKS_PAGE_SITE_HTTP_PROTOCOL ,
364
- settings .PLATFORM_PLAYBOOKS_PAGE_USE_SITE )
362
+
363
+ pb_exec_location = settings .PLATFORM_PLAYBOOKS_EXECUTION_PAGE_LOCATION .format (
364
+ p_proto .id .value , pe_proto .playbook_run_id .value )
365
+ pb_exec_protocol = settings .PLATFORM_PLAYBOOKS_PAGE_SITE_HTTP_PROTOCOL
366
+ pb_exec_use_sites = settings .PLATFORM_PLAYBOOKS_PAGE_USE_SITE
367
+
368
+ playbook_execution_url = build_absolute_uri (None , pb_exec_location , pb_exec_protocol , pb_exec_use_sites )
369
+
365
370
step_execution_logs = pe_proto .step_execution_logs
366
371
execution_output : [InterpretationProto ] = playbook_step_execution_result_interpret (step_execution_logs )
367
372
if workflow .actions [0 ].type == WorkflowActionProto .Type .SLACK_MESSAGE or workflow .actions [
@@ -370,15 +375,15 @@ def test_workflow_notification(user, account_id, workflow, message_type):
370
375
type = InterpretationProto .Type .TEXT ,
371
376
title = StringValue (value = f'Testing Workflow: "{ workflow .name .value } "' ),
372
377
description = StringValue (
373
- value = f'This is a sample run of <{ playbook_url } |{ p_proto .name .value } > playbook.' ),
378
+ value = f'This is a sample run of <{ playbook_execution_url } |{ p_proto .name .value } > playbook.' ),
374
379
model_type = InterpretationProto .ModelType .WORKFLOW_EXECUTION
375
380
)
376
381
else :
377
382
workflow_test_message = InterpretationProto (
378
383
type = InterpretationProto .Type .TEXT ,
379
384
title = StringValue (value = f'Testing Workflow: "{ workflow .name .value } "' ),
380
385
description = StringValue (
381
- value = f'This is a sample run of [{ p_proto .name .value } ]({ playbook_url } ) playbook.' ),
386
+ value = f'This is a sample run of [{ p_proto .name .value } ]({ playbook_execution_url } ) playbook.' ),
382
387
model_type = InterpretationProto .ModelType .WORKFLOW_EXECUTION
383
388
)
384
389
execution_output .insert (0 , workflow_test_message )
0 commit comments