diff --git a/web/store/issue/cycle/issue.store.ts b/web/store/issue/cycle/issue.store.ts index abdd141419b..45f7bb05d91 100644 --- a/web/store/issue/cycle/issue.store.ts +++ b/web/store/issue/cycle/issue.store.ts @@ -269,6 +269,10 @@ export class CycleIssues extends IssueHelperStore implements ICycleIssues { }); const response = await this.createIssue(workspaceSlug, projectId, data, cycleId); + + if (data.module_ids && data.module_ids.length > 0) + await this.rootStore.moduleIssues.addModulesToIssue(workspaceSlug, projectId, response.id, data.module_ids); + this.rootIssueStore.rootStore.cycle.fetchCycleDetails(workspaceSlug, projectId, cycleId); const quickAddIssueIndex = this.issues[cycleId].findIndex((_issueId) => _issueId === data.id); diff --git a/web/store/issue/module/issue.store.ts b/web/store/issue/module/issue.store.ts index 6e44e95a2fd..73c68bdde4a 100644 --- a/web/store/issue/module/issue.store.ts +++ b/web/store/issue/module/issue.store.ts @@ -274,6 +274,10 @@ export class ModuleIssues extends IssueHelperStore implements IModuleIssues { }); const response = await this.createIssue(workspaceSlug, projectId, data, moduleId); + + if (data.cycle_id && data.cycle_id !== "") + await this.rootStore.cycleIssues.addIssueToCycle(workspaceSlug, projectId, data.cycle_id, [response.id]); + this.rootIssueStore.rootStore.module.fetchModuleDetails(workspaceSlug, projectId, moduleId); const quickAddIssueIndex = this.issues[moduleId].findIndex((_issueId) => _issueId === data.id); diff --git a/web/store/issue/project-views/issue.store.ts b/web/store/issue/project-views/issue.store.ts index 2166f254f1b..d5de0e40044 100644 --- a/web/store/issue/project-views/issue.store.ts +++ b/web/store/issue/project-views/issue.store.ts @@ -239,6 +239,12 @@ export class ProjectViewIssues extends IssueHelperStore implements IProjectViewI const response = await this.createIssue(workspaceSlug, projectId, data, viewId); + if (data.cycle_id && data.cycle_id !== "") + await this.rootStore.cycleIssues.addIssueToCycle(workspaceSlug, projectId, data.cycle_id, [response.id]); + + if (data.module_ids && data.module_ids.length > 0) + await this.rootStore.moduleIssues.addModulesToIssue(workspaceSlug, projectId, response.id, data.module_ids); + const quickAddIssueIndex = this.issues[viewId].findIndex((_issueId) => _issueId === data.id); if (quickAddIssueIndex >= 0) runInAction(() => { diff --git a/web/store/issue/project/issue.store.ts b/web/store/issue/project/issue.store.ts index 123c943e88a..de612935907 100644 --- a/web/store/issue/project/issue.store.ts +++ b/web/store/issue/project/issue.store.ts @@ -223,6 +223,12 @@ export class ProjectIssues extends IssueHelperStore implements IProjectIssues { const response = await this.createIssue(workspaceSlug, projectId, data); + if (data.cycle_id && data.cycle_id !== "") + await this.rootStore.cycleIssues.addIssueToCycle(workspaceSlug, projectId, data.cycle_id, [response.id]); + + if (data.module_ids && data.module_ids.length > 0) + await this.rootStore.moduleIssues.addModulesToIssue(workspaceSlug, projectId, response.id, data.module_ids); + const quickAddIssueIndex = this.issues[projectId].findIndex((_issueId) => _issueId === data.id); if (quickAddIssueIndex >= 0) runInAction(() => {