Repository navigation
Fixes #37588: Task created notifications link to the task page (backport 2.1 #37589) - #38092
Conversation
Code Review ✅ Approved 🟡 Medium riskThe task-created template adds proposed changes and lifecycle moves to emails, so recipients could see task details; task links also change routes. Adds a dedicated task-created notification template that links tasks to VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
| "description": "System default template for task creation notifications (approval requests, update requests, incidents).", | ||
| "provider": "system", | ||
| "templateSubject": "[{{publisherName}}] - New {{#if entity.category}}{{camelCaseToTitle entity.category}} {{/if}}task{{#if entity.about}} for {{#if entity.about.displayName}}{{entity.about.displayName}}{{else}}{{entity.about.name}}{{/if}}{{/if}}", | ||
| "templateBody": "<strong>@{{#if entity.createdBy}}{{#if entity.createdBy.displayName}}{{entity.createdBy.displayName}}{{else}}{{entity.createdBy.name}}{{/if}}{{else}}{{event.userName}}{{/if}}</strong> created the {{#if entity.type}}<strong>{{camelCaseToTitle entity.type}}</strong> {{/if}}task <a href=\"{{buildEntityUrl event.entityType entity}}\">{{entity.taskId}}</a>{{#if entity.about}} for <strong>{{camelCaseToTitle entity.about.type}}</strong> <a href=\"{{buildEntityUrl entity.about.type entity.about.fullyQualifiedName}}\">{{#if entity.about.displayName}}{{entity.about.displayName}}{{else}}{{entity.about.fullyQualifiedName}}{{/if}}</a>{{/if}}.{{#if entity.description}}<br><br><blockquote>{{{processMentions entity.description}}}</blockquote>{{/if}}{{#if entity.payload.proposedChanges}}<br><strong>Proposed changes:</strong><ul>{{#each entity.payload.proposedChanges}}{{#if (or (length added) (length removed))}}<li><strong>{{camelCaseToTitle @key}}</strong>:{{#if added}} added {{#each added}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}{{/if}}{{#if removed}}{{#if added}};{{/if}} removed {{#each removed}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}{{/if}}</li>{{/if}}{{/each}}</ul>{{/if}}{{#with entity.payload.lifecycleMove}}<br>Approving moves this asset from <strong>{{stage}}</strong> to <strong>{{targetStage}}</strong>.{{/with}}{{#if entity.assignees}}<br><strong>Assignees:</strong> {{#each entity.assignees}}@{{#if displayName}}{{displayName}}{{else}}{{name}}{{/if}}{{#unless @last}}, {{/unless}}{{/each}}{{/if}}" |
There was a problem hiding this comment.
Query asset links are empty. For a task about a query, this call passes only
entity.about.fullyQualifiedName. The helper then drops entity.about.id, but buildQueryUrl requires that ID and returns null without it. The email therefore renders the query link with an empty address. Pass the full entity.about reference for queries and add a test covering that asset type.
Describe your changes:
Backport of #37589 to
2.1. Fixes #37588.A task-created email linked to
/task/TASK-xxxxx, a page the UI does not have, so the link gave a 404. There was no task-created template, so the generic entity-created one was used. This addssystem-notification-task-entity-created, which links the task to/tasks/{taskId}and the asset to its page, and lists the proposed changes, the lifecycle stage move and the assignees.buildEntityUrlgains ataskcase for the same route.Cherry-picked from
144bbc5ea49; applied cleanly, andgit patch-id --stableis identical to the original commit.Type of change:
Tests:
Unit tests
TaskEntityCreatedTemplateTest,BuildEntityUrlHelperTest,SystemTemplateParityTestandTaskEntityUpdatedTemplateTeston2.1: 25 passed.Backend integration tests
UI screen recording:
Not applicable: backend-only change.
Checklist:
Fixes #<issue-number>above.REVIEW.md; no findings.The PR appears safe to merge with one non-blocking issue affecting query asset links.
Findings
Summary
Adds a task-created notification with links to the task and its asset, plus details about requested changes and assignees.
Reviews (1) · Last reviewed commit: "Fixes #37588: Task created notifications..." · Reviewed by Greptile