diff --git a/public/pages/Correlations/containers/CreateCorrelationRule.tsx b/public/pages/Correlations/containers/CreateCorrelationRule.tsx index 737d8b32..f76a3eb1 100644 --- a/public/pages/Correlations/containers/CreateCorrelationRule.tsx +++ b/public/pages/Correlations/containers/CreateCorrelationRule.tsx @@ -234,18 +234,20 @@ export const CreateCorrelationRule: React.FC = ( setNotificationChannels(parsedChannels); setLoadingNotifications(false); }; - const setInitialRuleValues = async (ruleId: string) => { - const ruleRes = await correlationStore.getCorrelationRule(ruleId); - if (ruleRes) { - setInitialValues(ruleRes); - } - }; if (props.history.location.state?.rule) { setAction('Edit'); - setInitialRuleValues(props.history.location.state?.rule.id); + setInitialValues(props.history.location.state?.rule); } else if (params.ruleId) { - setInitialRuleValues(params.ruleId); + const setInitialRuleValues = async () => { + const ruleRes = await correlationStore.getCorrelationRule(params.ruleId); + if (ruleRes) { + setInitialValues(ruleRes); + } + }; + + setAction('Edit'); + setInitialRuleValues(); } const setupLogTypeOptions = async () => { diff --git a/public/store/CorrelationsStore.ts b/public/store/CorrelationsStore.ts index 639d275e..cb8ef9d2 100644 --- a/public/store/CorrelationsStore.ts +++ b/public/store/CorrelationsStore.ts @@ -174,6 +174,7 @@ export class CorrelationsStore implements ICorrelationsStore { name: hit._source.name, time_window: hit._source.time_window || 300000, queries, + trigger: hit._source?.trigger }; }); }