From 81fbac2a73ca0e7b18b645297f848c60f623e18b Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Fri, 13 Sep 2024 19:46:06 +0500 Subject: [PATCH] Change todo title with issue title (#6563) --- server-plugins/time-resources/src/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server-plugins/time-resources/src/index.ts b/server-plugins/time-resources/src/index.ts index 9d7b1850c8..d4663f9542 100644 --- a/server-plugins/time-resources/src/index.ts +++ b/server-plugins/time-resources/src/index.ts @@ -582,7 +582,7 @@ async function changeIssueStatusHandler ( return [] } -async function changeIssueNumberHandler (control: TriggerControl, issueId: Ref): Promise { +async function changeIssueDataHandler (control: TriggerControl, issueId: Ref): Promise { const res: Tx[] = [] const issue = (await control.findAll(control.ctx, tracker.class.Issue, { _id: issueId }))[0] if (issue !== undefined) { @@ -632,9 +632,10 @@ async function updateIssueHandler (tx: TxUpdateDoc, control: TriggerContr if (newStatus !== undefined) { res.push(...(await changeIssueStatusHandler(control, newStatus, tx.objectId))) } + const name = tx.operations.title const number = tx.operations.number - if (number !== undefined) { - res.push(...(await changeIssueNumberHandler(control, tx.objectId))) + if (number !== undefined || name !== undefined) { + res.push(...(await changeIssueDataHandler(control, tx.objectId))) } return res }