Change todo title with issue title (#6563)

This commit is contained in:
Denis Bykhov 2024-09-13 19:46:06 +05:00 committed by GitHub
parent 0ba3e2efbc
commit 81fbac2a73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -582,7 +582,7 @@ async function changeIssueStatusHandler (
return [] return []
} }
async function changeIssueNumberHandler (control: TriggerControl, issueId: Ref<Issue>): Promise<Tx[]> { async function changeIssueDataHandler (control: TriggerControl, issueId: Ref<Issue>): Promise<Tx[]> {
const res: Tx[] = [] const res: Tx[] = []
const issue = (await control.findAll(control.ctx, tracker.class.Issue, { _id: issueId }))[0] const issue = (await control.findAll(control.ctx, tracker.class.Issue, { _id: issueId }))[0]
if (issue !== undefined) { if (issue !== undefined) {
@ -632,9 +632,10 @@ async function updateIssueHandler (tx: TxUpdateDoc<Issue>, control: TriggerContr
if (newStatus !== undefined) { if (newStatus !== undefined) {
res.push(...(await changeIssueStatusHandler(control, newStatus, tx.objectId))) res.push(...(await changeIssueStatusHandler(control, newStatus, tx.objectId)))
} }
const name = tx.operations.title
const number = tx.operations.number const number = tx.operations.number
if (number !== undefined) { if (number !== undefined || name !== undefined) {
res.push(...(await changeIssueNumberHandler(control, tx.objectId))) res.push(...(await changeIssueDataHandler(control, tx.objectId)))
} }
return res return res
} }