diff --git a/.gitignore b/.gitignore
index eaaadc2..caa490f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -158,10 +158,6 @@
 
 ### VisualStudioCode ###
 .vscode/*
-!.vscode/settings.json
-!.vscode/tasks.json
-!.vscode/launch.json
-!.vscode/extensions.json
 *.code-workspace
 
 ### VisualStudioCode Patch ###
diff --git a/src/interfaces/trigger_factory.hpp b/src/interfaces/trigger_factory.hpp
index 7d448d0..d493b4a 100644
--- a/src/interfaces/trigger_factory.hpp
+++ b/src/interfaces/trigger_factory.hpp
@@ -1,5 +1,6 @@
 #pragma once
 
+#include "interfaces/json_storage.hpp"
 #include "interfaces/trigger.hpp"
 #include "interfaces/trigger_manager.hpp"
 #include "interfaces/trigger_types.hpp"
@@ -26,7 +27,8 @@
             std::pair<sdbusplus::message::object_path, std::string>>& sensors,
         const std::vector<std::string>& reportNames,
         const TriggerThresholdParams& thresholdParams,
-        interfaces::TriggerManager& triggerManager) const = 0;
+        interfaces::TriggerManager& triggerManager,
+        interfaces::JsonStorage& triggerStorage) const = 0;
 };
 
 } // namespace interfaces
diff --git a/src/interfaces/trigger_types.hpp b/src/interfaces/trigger_types.hpp
index 90c673d..1833171 100644
--- a/src/interfaces/trigger_types.hpp
+++ b/src/interfaces/trigger_types.hpp
@@ -1,6 +1,8 @@
 #pragma once
 
 #include "utils/conversion.hpp"
+#include "utils/labeled_tuple.hpp"
+#include "utils/tstring.hpp"
 
 #include <string>
 #include <tuple>
@@ -38,6 +40,12 @@
 }
 
 using ThresholdParam = std::tuple<std::string, std::string, uint64_t, double>;
+
+using LabeledThresholdParam =
+    utils::LabeledTuple<std::tuple<std::string, Severity, uint64_t, double>,
+                        utils::tstring::UserId, utils::tstring::Severity,
+                        utils::tstring::DwellTime,
+                        utils::tstring::ThresholdValue>;
 } // namespace discrete
 
 namespace numeric
@@ -95,8 +103,22 @@
 }
 
 using ThresholdParam = std::tuple<std::string, uint64_t, std::string, double>;
+
+using LabeledThresholdParam =
+    utils::LabeledTuple<std::tuple<Type, uint64_t, Direction, double>,
+                        utils::tstring::Type, utils::tstring::DwellTime,
+                        utils::tstring::Direction,
+                        utils::tstring::ThresholdValue>;
 } // namespace numeric
 
+using TriggerSensors =
+    std::vector<std::pair<sdbusplus::message::object_path, std::string>>;
+
+using LabeledTriggerSensor =
+    utils::LabeledTuple<std::tuple<std::string, std::string>,
+                        utils::tstring::SensorPath,
+                        utils::tstring::SensorMetadata>;
+
 using TriggerThresholdParams =
     std::variant<std::vector<numeric::ThresholdParam>,
                  std::vector<discrete::ThresholdParam>>;
diff --git a/src/interfaces/types.hpp b/src/interfaces/types.hpp
index a5ed0db..a3a1b1c 100644
--- a/src/interfaces/types.hpp
+++ b/src/interfaces/types.hpp
@@ -28,4 +28,4 @@
 
 using Readings = std::tuple<
     uint64_t,
-    std::vector<std::tuple<std::string, std::string, double, uint64_t>>>;
+    std::vector<std::tuple<std::string, std::string, double, uint64_t>>>;
\ No newline at end of file
diff --git a/src/telemetry.hpp b/src/telemetry.hpp
index fb7f2a3..be2d81c 100644
--- a/src/telemetry.hpp
+++ b/src/telemetry.hpp
@@ -25,6 +25,9 @@
             objServer),
         triggerManager(std::make_unique<TriggerFactory>(
                            bus, objServer, sensorCache, reportManager),
+                       std::make_unique<PersistentJsonStorage>(
+                           interfaces::JsonStorage::DirectoryPath(
+                               "/var/lib/telemetry/Triggers")),
                        objServer)
     {}
 
diff --git a/src/trigger.cpp b/src/trigger.cpp
index 471ad10..2bba3ea 100644
--- a/src/trigger.cpp
+++ b/src/trigger.cpp
@@ -1,26 +1,44 @@
 #include "trigger.hpp"
 
 #include "interfaces/types.hpp"
+#include "utils/transform.hpp"
+
+#include <phosphor-logging/log.hpp>
+
+template <class... Ts>
+struct overloaded : Ts...
+{
+    using Ts::operator()...;
+};
+template <class... Ts>
+overloaded(Ts...) -> overloaded<Ts...>;
 
 Trigger::Trigger(
     boost::asio::io_context& ioc,
     const std::shared_ptr<sdbusplus::asio::object_server>& objServer,
-    const std::string& nameIn, const bool isDiscrete, const bool logToJournal,
-    const bool logToRedfish, const bool updateReport,
-    const std::vector<std::pair<sdbusplus::message::object_path, std::string>>&
-        sensorsIn,
+    const std::string& nameIn, const bool isDiscreteIn,
+    const bool logToJournalIn, const bool logToRedfishIn,
+    const bool updateReportIn, const TriggerSensors& sensorsIn,
     const std::vector<std::string>& reportNamesIn,
     const TriggerThresholdParams& thresholdParamsIn,
     std::vector<std::shared_ptr<interfaces::Threshold>>&& thresholdsIn,
-    interfaces::TriggerManager& triggerManager) :
+    interfaces::TriggerManager& triggerManager,
+    interfaces::JsonStorage& triggerStorageIn) :
     name(nameIn),
-    path(triggerDir + name), persistent(false), sensors(sensorsIn),
-    reportNames(reportNamesIn), thresholdParams(thresholdParamsIn),
-    thresholds(std::move(thresholdsIn))
+    isDiscrete(isDiscreteIn), logToJournal(logToJournalIn),
+    logToRedfish(logToRedfishIn), updateReport(updateReportIn),
+    path(triggerDir + name), sensors(sensorsIn), reportNames(reportNamesIn),
+    thresholdParams(thresholdParamsIn), thresholds(std::move(thresholdsIn)),
+    fileName(std::to_string(std::hash<std::string>{}(name))),
+    triggerStorage(triggerStorageIn)
 {
     deleteIface = objServer->add_unique_interface(
         path, deleteIfaceName, [this, &ioc, &triggerManager](auto& dbusIface) {
             dbusIface.register_method("Delete", [this, &ioc, &triggerManager] {
+                if (persistent)
+                {
+                    triggerStorage.remove(fileName);
+                }
                 boost::asio::post(ioc, [this, &triggerManager] {
                     triggerManager.removeTrigger(this);
                 });
@@ -29,12 +47,30 @@
 
     triggerIface = objServer->add_unique_interface(
         path, triggerIfaceName,
-        [this, isDiscrete, logToJournal, logToRedfish,
-         updateReport](auto& dbusIface) {
-            dbusIface.register_property_r(
+        [this, isDiscreteIn, logToJournalIn, logToRedfishIn,
+         updateReportIn](auto& dbusIface) {
+            persistent = storeConfiguration();
+            dbusIface.register_property_rw(
                 "Persistent", persistent,
                 sdbusplus::vtable::property_::emits_change,
-                [](const auto& x) { return x; });
+                [this](bool newVal, const auto&) {
+                    if (newVal == persistent)
+                    {
+                        return true;
+                    }
+                    if (newVal)
+                    {
+                        persistent = storeConfiguration();
+                    }
+                    else
+                    {
+                        triggerStorage.remove(fileName);
+                        persistent = false;
+                    }
+                    return true;
+                },
+                [this](const auto&) { return persistent; });
+
             dbusIface.register_property_r(
                 "Thresholds", thresholdParams,
                 sdbusplus::vtable::property_::emits_change,
@@ -65,3 +101,62 @@
         threshold->initialize();
     }
 }
+
+bool Trigger::storeConfiguration() const
+{
+    try
+    {
+        nlohmann::json data;
+
+        data["Version"] = triggerVersion;
+        data["Name"] = name;
+        data["ThresholdParamsDiscriminator"] = thresholdParams.index();
+        data["IsDiscrete"] = isDiscrete;
+        data["LogToJournal"] = logToJournal;
+        data["LogToRedfish"] = logToRedfish;
+        data["UpdateReport"] = updateReport;
+
+        std::visit(
+            overloaded{
+                [&](const std::vector<numeric::ThresholdParam>& arg) {
+                    data["ThresholdParams"] =
+                        utils::transform(arg, [](const auto& thresholdParam) {
+                            const auto& [type, dwellTime, direction,
+                                         thresholdValue] = thresholdParam;
+                            return numeric::LabeledThresholdParam(
+                                numeric::stringToType(type), dwellTime,
+                                numeric::stringToDirection(direction),
+                                thresholdValue);
+                        });
+                },
+                [&](const std::vector<discrete::ThresholdParam>& arg) {
+                    data["ThresholdParams"] =
+                        utils::transform(arg, [](const auto& thresholdParam) {
+                            const auto& [userId, severity, dwellTime,
+                                         thresholdValue] = thresholdParam;
+                            return discrete::LabeledThresholdParam(
+                                userId, discrete::stringToSeverity(severity),
+                                dwellTime, thresholdValue);
+                        });
+                },
+            },
+            thresholdParams);
+
+        data["ReportNames"] = reportNames;
+
+        data["Sensors"] = utils::transform(sensors, [](const auto& sensor) {
+            const auto& [sensorPath, sensorMetadata] = sensor;
+            return LabeledTriggerSensor(sensorPath, sensorMetadata);
+        });
+
+        triggerStorage.store(fileName, data);
+    }
+    catch (const std::exception& e)
+    {
+        phosphor::logging::log<phosphor::logging::level::ERR>(
+            "Failed to store a trigger in storage",
+            phosphor::logging::entry("EXCEPTION_MSG=%s", e.what()));
+        return false;
+    }
+    return true;
+}
\ No newline at end of file
diff --git a/src/trigger.hpp b/src/trigger.hpp
index 3405c5b..b2bdc1d 100644
--- a/src/trigger.hpp
+++ b/src/trigger.hpp
@@ -1,5 +1,6 @@
 #pragma once
 
+#include "interfaces/json_storage.hpp"
 #include "interfaces/threshold.hpp"
 #include "interfaces/trigger.hpp"
 #include "interfaces/trigger_manager.hpp"
@@ -23,7 +24,8 @@
         const std::vector<std::string>& reportNames,
         const TriggerThresholdParams& thresholdParams,
         std::vector<std::shared_ptr<interfaces::Threshold>>&& thresholds,
-        interfaces::TriggerManager& triggerManager);
+        interfaces::TriggerManager& triggerManager,
+        interfaces::JsonStorage& triggerStorage);
 
     Trigger(const Trigger&) = delete;
     Trigger(Trigger&&) = delete;
@@ -40,18 +42,26 @@
         return path;
     }
 
+    bool storeConfiguration() const;
+
   private:
     const std::string name;
+    bool isDiscrete;
+    bool logToJournal;
+    bool logToRedfish;
+    bool updateReport;
     const std::string path;
-    bool persistent;
-    std::vector<std::pair<sdbusplus::message::object_path, std::string>>
-        sensors;
+    bool persistent = false;
+    TriggerSensors sensors;
     std::vector<std::string> reportNames;
     TriggerThresholdParams thresholdParams;
     std::unique_ptr<sdbusplus::asio::dbus_interface> deleteIface;
     std::unique_ptr<sdbusplus::asio::dbus_interface> triggerIface;
     std::vector<std::shared_ptr<interfaces::Threshold>> thresholds;
 
+    interfaces::JsonStorage::FilePath fileName;
+    interfaces::JsonStorage& triggerStorage;
+
   public:
     static constexpr const char* triggerIfaceName =
         "xyz.openbmc_project.Telemetry.Trigger";
@@ -59,4 +69,5 @@
         "/xyz/openbmc_project/Telemetry/Triggers/";
     static constexpr const char* deleteIfaceName =
         "xyz.openbmc_project.Object.Delete";
+    static constexpr size_t triggerVersion = 0;
 };
diff --git a/src/trigger_factory.cpp b/src/trigger_factory.cpp
index 3114e9a..e039e1f 100644
--- a/src/trigger_factory.cpp
+++ b/src/trigger_factory.cpp
@@ -17,14 +17,15 @@
     reportManager(reportManager)
 {}
 
-std::unique_ptr<interfaces::Trigger> TriggerFactory::make(
-    boost::asio::yield_context& yield, const std::string& name, bool isDiscrete,
-    bool logToJournal, bool logToRedfish, bool updateReport,
-    const std::vector<std::pair<sdbusplus::message::object_path, std::string>>&
-        sensorPaths,
-    const std::vector<std::string>& reportNames,
-    const TriggerThresholdParams& thresholdParams,
-    interfaces::TriggerManager& triggerManager) const
+std::unique_ptr<interfaces::Trigger>
+    TriggerFactory::make(boost::asio::yield_context& yield,
+                         const std::string& name, bool isDiscrete,
+                         bool logToJournal, bool logToRedfish,
+                         bool updateReport, const TriggerSensors& sensorPaths,
+                         const std::vector<std::string>& reportNames,
+                         const TriggerThresholdParams& thresholdParams,
+                         interfaces::TriggerManager& triggerManager,
+                         interfaces::JsonStorage& triggerStorage) const
 {
     auto [sensors, sensorNames] = getSensors(yield, sensorPaths);
     std::vector<std::shared_ptr<interfaces::Threshold>> thresholds;
@@ -121,7 +122,7 @@
     return std::make_unique<Trigger>(
         bus->get_io_context(), objServer, name, isDiscrete, logToJournal,
         logToRedfish, updateReport, sensorPaths, reportNames, thresholdParams,
-        std::move(thresholds), triggerManager);
+        std::move(thresholds), triggerManager, triggerStorage);
 }
 
 std::pair<std::vector<std::shared_ptr<interfaces::Sensor>>,
diff --git a/src/trigger_factory.hpp b/src/trigger_factory.hpp
index c1f2473..a6fbb68 100644
--- a/src/trigger_factory.hpp
+++ b/src/trigger_factory.hpp
@@ -23,7 +23,8 @@
             std::pair<sdbusplus::message::object_path, std::string>>& sensors,
         const std::vector<std::string>& reportNames,
         const TriggerThresholdParams& thresholdParams,
-        interfaces::TriggerManager& triggerManager) const override;
+        interfaces::TriggerManager& triggerManager,
+        interfaces::JsonStorage& triggerStorage) const override;
 
   private:
     std::shared_ptr<sdbusplus::asio::connection> bus;
diff --git a/src/trigger_manager.cpp b/src/trigger_manager.cpp
index bf372c2..3882022 100644
--- a/src/trigger_manager.cpp
+++ b/src/trigger_manager.cpp
@@ -2,8 +2,10 @@
 
 TriggerManager::TriggerManager(
     std::unique_ptr<interfaces::TriggerFactory> triggerFactoryIn,
+    std::unique_ptr<interfaces::JsonStorage> triggerStorageIn,
     const std::shared_ptr<sdbusplus::asio::object_server>& objServer) :
-    triggerFactory(std::move(triggerFactoryIn))
+    triggerFactory(std::move(triggerFactoryIn)),
+    triggerStorage(std::move(triggerStorageIn))
 {
     managerIface = objServer->add_unique_interface(
         triggerManagerPath, triggerManagerIfaceName, [this](auto& iface) {
@@ -36,7 +38,8 @@
 
                     triggers.emplace_back(triggerFactory->make(
                         yield, name, isDiscrete, logToJournal, logToRedfish,
-                        updateReport, sensors, reportNames, thresholds, *this));
+                        updateReport, sensors, reportNames, thresholds, *this,
+                        *triggerStorage));
                     return triggers.back()->getPath();
                 });
         });
diff --git a/src/trigger_manager.hpp b/src/trigger_manager.hpp
index 41257eb..1db6d73 100644
--- a/src/trigger_manager.hpp
+++ b/src/trigger_manager.hpp
@@ -14,6 +14,7 @@
   public:
     TriggerManager(
         std::unique_ptr<interfaces::TriggerFactory> triggerFactory,
+        std::unique_ptr<interfaces::JsonStorage> triggerStorage,
         const std::shared_ptr<sdbusplus::asio::object_server>& objServer);
 
     TriggerManager(TriggerManager&) = delete;
@@ -25,6 +26,7 @@
 
   private:
     std::unique_ptr<interfaces::TriggerFactory> triggerFactory;
+    std::unique_ptr<interfaces::JsonStorage> triggerStorage;
     std::unique_ptr<sdbusplus::asio::dbus_interface> managerIface;
     std::vector<std::unique_ptr<interfaces::Trigger>> triggers;
 
diff --git a/src/utils/tstring.hpp b/src/utils/tstring.hpp
index a8d3e90..5b17d98 100644
--- a/src/utils/tstring.hpp
+++ b/src/utils/tstring.hpp
@@ -24,6 +24,14 @@
     }
 };
 
+struct SensorMetadata
+{
+    static std::string str()
+    {
+        return "sensorMetadata";
+    }
+};
+
 struct OperationType
 {
     static std::string str()
@@ -56,5 +64,53 @@
     }
 };
 
+struct Type
+{
+    static std::string str()
+    {
+        return "type";
+    }
+};
+
+struct DwellTime
+{
+    static std::string str()
+    {
+        return "dwellTime";
+    }
+};
+
+struct Direction
+{
+    static std::string str()
+    {
+        return "direction";
+    }
+};
+
+struct ThresholdValue
+{
+    static std::string str()
+    {
+        return "thresholdValue";
+    }
+};
+
+struct UserId
+{
+    static std::string str()
+    {
+        return "userId";
+    }
+};
+
+struct Severity
+{
+    static std::string str()
+    {
+        return "severity";
+    }
+};
+
 } // namespace tstring
 } // namespace utils
diff --git a/tests/src/mocks/trigger_factory_mock.hpp b/tests/src/mocks/trigger_factory_mock.hpp
index cf1be55..8249799 100644
--- a/tests/src/mocks/trigger_factory_mock.hpp
+++ b/tests/src/mocks/trigger_factory_mock.hpp
@@ -13,7 +13,7 @@
     {
         using namespace testing;
 
-        ON_CALL(*this, make(_, _, _, _, _, _, _, _, _, _))
+        ON_CALL(*this, make(_, _, _, _, _, _, _, _, _, _, _))
             .WillByDefault(WithArgs<1>(Invoke([](const std::string& name) {
                 return std::make_unique<NiceMock<TriggerMock>>(name);
             })));
@@ -27,12 +27,14 @@
              std::pair<sdbusplus::message::object_path, std::string>>& sensors),
          const std::vector<std::string>& reportNames,
          const TriggerThresholdParams& thresholdParams,
-         interfaces::TriggerManager& triggerManager),
+         interfaces::TriggerManager& triggerManager,
+         interfaces::JsonStorage& triggerStorage),
         (const, override));
 
     auto& expectMake(
         std::optional<std::reference_wrapper<const TriggerParams>> paramsOpt,
-        const testing::Matcher<interfaces::TriggerManager&>& tm)
+        const testing::Matcher<interfaces::TriggerManager&>& tm,
+        const testing::Matcher<interfaces::JsonStorage&>& triggerStorage)
     {
         using namespace testing;
 
@@ -40,15 +42,16 @@
         {
             const TriggerParams& params = *paramsOpt;
             return EXPECT_CALL(
-                *this,
-                make(_, params.name(), params.isDiscrete(),
-                     params.logToJournal(), params.logToRedfish(),
-                     params.updateReport(), params.sensors(),
-                     params.reportNames(), params.thresholdParams(), tm));
+                *this, make(_, params.name(), params.isDiscrete(),
+                            params.logToJournal(), params.logToRedfish(),
+                            params.updateReport(), params.sensors(),
+                            params.reportNames(), params.thresholdParams(), tm,
+                            triggerStorage));
         }
         else
         {
-            return EXPECT_CALL(*this, make(_, _, _, _, _, _, _, _, _, tm));
+            return EXPECT_CALL(
+                *this, make(_, _, _, _, _, _, _, _, _, tm, triggerStorage));
         }
     }
 };
diff --git a/tests/src/params/trigger_params.hpp b/tests/src/params/trigger_params.hpp
index 95b19d2..08bed4b 100644
--- a/tests/src/params/trigger_params.hpp
+++ b/tests/src/params/trigger_params.hpp
@@ -42,13 +42,18 @@
         return logToRedfishProperty;
     }
 
+    TriggerParams& updateReport(bool updateReport)
+    {
+        updateReportProperty = updateReport;
+        return *this;
+    }
+
     bool updateReport() const
     {
         return updateReportProperty;
     }
 
-    const std::vector<std::pair<sdbusplus::message::object_path, std::string>>&
-        sensors() const
+    const TriggerSensors& sensors() const
     {
         return sensorsProperty;
     }
@@ -74,12 +79,11 @@
     bool discreteProperty = false;
     bool logToJournalProperty = false;
     bool logToRedfishProperty = false;
-    bool updateReportProperty = false;
-    std::vector<std::pair<sdbusplus::message::object_path, std::string>>
-        sensorsProperty = {
-            {sdbusplus::message::object_path(
-                 "/xyz/openbmc_project/sensors/temperature/BMC_Temp"),
-             ""}};
+    bool updateReportProperty = true;
+    TriggerSensors sensorsProperty = {
+        {sdbusplus::message::object_path(
+             "/xyz/openbmc_project/sensors/temperature/BMC_Temp"),
+         ""}};
     std::vector<std::string> reportNamesProperty = {"Report1"};
     TriggerThresholdParams thresholdsProperty =
         std::vector<numeric::ThresholdParam>{
diff --git a/tests/src/test_trigger.cpp b/tests/src/test_trigger.cpp
index b2b259c..f396589 100644
--- a/tests/src/test_trigger.cpp
+++ b/tests/src/test_trigger.cpp
@@ -1,5 +1,6 @@
 #include "dbus_environment.hpp"
 #include "helpers.hpp"
+#include "mocks/json_storage_mock.hpp"
 #include "mocks/trigger_manager_mock.hpp"
 #include "params/trigger_params.hpp"
 #include "trigger.hpp"
@@ -8,6 +9,8 @@
 using namespace testing;
 using namespace std::literals::string_literals;
 
+static constexpr size_t expectedTriggerVersion = 0;
+
 class TestTrigger : public Test
 {
   public:
@@ -15,18 +18,29 @@
 
     std::unique_ptr<TriggerManagerMock> triggerManagerMockPtr =
         std::make_unique<NiceMock<TriggerManagerMock>>();
+    testing::NiceMock<StorageMock> storageMock;
     std::unique_ptr<Trigger> sut;
 
     void SetUp() override
     {
-        sut = std::make_unique<Trigger>(
+        sut = makeTrigger(triggerParams);
+    }
+
+    std::unique_ptr<Trigger> makeTrigger(const TriggerParams& params)
+    {
+        return std::make_unique<Trigger>(
             DbusEnvironment::getIoc(), DbusEnvironment::getObjServer(),
-            triggerParams.name(), triggerParams.isDiscrete(),
-            triggerParams.logToJournal(), triggerParams.logToRedfish(),
-            triggerParams.updateReport(), triggerParams.sensors(),
-            triggerParams.reportNames(), triggerParams.thresholdParams(),
+            params.name(), params.isDiscrete(), params.logToJournal(),
+            params.logToRedfish(), params.updateReport(), params.sensors(),
+            params.reportNames(), params.thresholdParams(),
             std::vector<std::shared_ptr<interfaces::Threshold>>{},
-            *triggerManagerMockPtr);
+            *triggerManagerMockPtr, storageMock);
+    }
+
+    static interfaces::JsonStorage::FilePath to_file_path(std::string name)
+    {
+        return interfaces::JsonStorage::FilePath(
+            std::to_string(std::hash<std::string>{}(name)));
     }
 
     template <class T>
@@ -48,6 +62,24 @@
         return DbusEnvironment::waitForFuture(std::move(propertyFuture));
     }
 
+    template <class T>
+    static boost::system::error_code setProperty(const std::string& path,
+                                                 const std::string& property,
+                                                 const T& newValue)
+    {
+        auto setPromise = std::promise<boost::system::error_code>();
+        auto setFuture = setPromise.get_future();
+
+        sdbusplus::asio::setProperty(
+            *DbusEnvironment::getBus(), DbusEnvironment::serviceName(), path,
+            Trigger::triggerIfaceName, property, std::move(newValue),
+            [setPromise =
+                 std::move(setPromise)](boost::system::error_code ec) mutable {
+                setPromise.set_value(ec);
+            });
+        return DbusEnvironment::waitForFuture(std::move(setFuture));
+    }
+
     boost::system::error_code deleteTrigger(const std::string& path)
     {
         std::promise<boost::system::error_code> methodPromise;
@@ -63,6 +95,7 @@
 
 TEST_F(TestTrigger, checkIfPropertiesAreSet)
 {
+    EXPECT_THAT(getProperty<bool>(sut->getPath(), "Persistent"), Eq(true));
     EXPECT_THAT(getProperty<bool>(sut->getPath(), "Discrete"),
                 Eq(triggerParams.isDiscrete()));
     EXPECT_THAT(getProperty<bool>(sut->getPath(), "LogToJournal"),
@@ -85,6 +118,7 @@
 
 TEST_F(TestTrigger, deleteTrigger)
 {
+    EXPECT_CALL(storageMock, remove(to_file_path(sut->getName())));
     EXPECT_CALL(*triggerManagerMockPtr, removeTrigger(sut.get()));
     auto ec = deleteTrigger(sut->getPath());
     EXPECT_THAT(ec, Eq(boost::system::errc::success));
@@ -95,3 +129,125 @@
     auto ec = deleteTrigger(Trigger::triggerDir + "NonExisting"s);
     EXPECT_THAT(ec.value(), Eq(EBADR));
 }
+
+TEST_F(TestTrigger, settingPersistencyToFalseRemovesReportFromStorage)
+{
+    EXPECT_CALL(storageMock, remove(to_file_path(sut->getName())));
+
+    bool persistent = false;
+    EXPECT_THAT(setProperty(sut->getPath(), "Persistent", persistent).value(),
+                Eq(boost::system::errc::success));
+    EXPECT_THAT(getProperty<bool>(sut->getPath(), "Persistent"),
+                Eq(persistent));
+}
+
+class TestTriggerErrors : public TestTrigger
+{
+  public:
+    void SetUp() override
+    {}
+
+    nlohmann::json storedConfiguration;
+};
+
+TEST_F(TestTriggerErrors, throwingExceptionDoesNotStoreTriggerReportNames)
+{
+    EXPECT_CALL(storageMock, store(_, _))
+        .WillOnce(Throw(std::runtime_error("Generic error!")));
+
+    sut = makeTrigger(triggerParams);
+
+    EXPECT_THAT(getProperty<bool>(sut->getPath(), "Persistent"), Eq(false));
+}
+
+TEST_F(TestTriggerErrors, creatingTriggerThrowsExceptionWhenNameIsInvalid)
+{
+    EXPECT_CALL(storageMock, store(_, _)).Times(0);
+
+    EXPECT_THROW(makeTrigger(triggerParams.name("inv?lidName")),
+                 sdbusplus::exception::SdBusError);
+}
+
+class TestTriggerStore : public TestTrigger
+{
+  public:
+    void SetUp() override
+    {
+        ON_CALL(storageMock, store(_, _))
+            .WillByDefault(SaveArg<1>(&storedConfiguration));
+
+        sut = makeTrigger(triggerParams);
+    }
+
+    nlohmann::json storedConfiguration;
+};
+
+TEST_F(TestTriggerStore, settingPersistencyToTrueStoresTriggerVersion)
+{
+    ASSERT_THAT(storedConfiguration.at("Version"), Eq(expectedTriggerVersion));
+}
+
+TEST_F(TestTriggerStore, settingPersistencyToTrueStoresTriggerName)
+{
+    ASSERT_THAT(storedConfiguration.at("Name"), Eq(triggerParams.name()));
+}
+
+TEST_F(TestTriggerStore, settingPersistencyToTrueStoresTriggerIsDiscrete)
+{
+    ASSERT_THAT(storedConfiguration.at("IsDiscrete"),
+                Eq(triggerParams.isDiscrete()));
+}
+
+TEST_F(TestTriggerStore, settingPersistencyToTrueStoresTriggerLogToJournal)
+{
+    ASSERT_THAT(storedConfiguration.at("LogToJournal"),
+                Eq(triggerParams.logToRedfish()));
+}
+
+TEST_F(TestTriggerStore, settingPersistencyToTrueStoresTriggerLogToRedfish)
+{
+    ASSERT_THAT(storedConfiguration.at("LogToRedfish"),
+                Eq(triggerParams.logToRedfish()));
+}
+
+TEST_F(TestTriggerStore, settingPersistencyToTrueStoresTriggerUpdateReport)
+{
+    ASSERT_THAT(storedConfiguration.at("UpdateReport"),
+                Eq(triggerParams.updateReport()));
+}
+
+TEST_F(TestTriggerStore, settingPersistencyToTrueStoresTriggerReportNames)
+{
+    ASSERT_THAT(storedConfiguration.at("ReportNames"),
+                Eq(triggerParams.reportNames()));
+}
+
+TEST_F(TestTriggerStore, settingPersistencyToTrueStoresTriggerSensors)
+{
+    nlohmann::json expectedItem;
+    expectedItem["sensorPath"] =
+        "/xyz/openbmc_project/sensors/temperature/BMC_Temp";
+    expectedItem["sensorMetadata"] = "";
+
+    ASSERT_THAT(storedConfiguration.at("Sensors"), ElementsAre(expectedItem));
+}
+
+TEST_F(TestTriggerStore, settingPersistencyToTrueStoresTriggerThresholdParams)
+{
+    ASSERT_THAT(storedConfiguration.at("ThresholdParamsDiscriminator"), Eq(0));
+
+    nlohmann::json expectedItem0;
+    expectedItem0["type"] = 0;
+    expectedItem0["dwellTime"] = 10;
+    expectedItem0["direction"] = 1;
+    expectedItem0["thresholdValue"] = 0.0;
+
+    nlohmann::json expectedItem1;
+    expectedItem1["type"] = 3;
+    expectedItem1["dwellTime"] = 10;
+    expectedItem1["direction"] = 2;
+    expectedItem1["thresholdValue"] = 90.0;
+
+    ASSERT_THAT(storedConfiguration.at("ThresholdParams"),
+                ElementsAre(expectedItem0, expectedItem1));
+}
diff --git a/tests/src/test_trigger_manager.cpp b/tests/src/test_trigger_manager.cpp
index 8754446..1bc4f1b 100644
--- a/tests/src/test_trigger_manager.cpp
+++ b/tests/src/test_trigger_manager.cpp
@@ -1,5 +1,6 @@
 #include "dbus_environment.hpp"
 #include "helpers.hpp"
+#include "mocks/json_storage_mock.hpp"
 #include "mocks/trigger_factory_mock.hpp"
 #include "mocks/trigger_mock.hpp"
 #include "params/trigger_params.hpp"
@@ -29,6 +30,9 @@
     }
 
     TriggerParams triggerParams;
+    std::unique_ptr<StorageMock> storageMockPtr =
+        std::make_unique<NiceMock<StorageMock>>();
+    StorageMock& storageMock = *storageMockPtr;
     std::unique_ptr<TriggerFactoryMock> triggerFactoryMockPtr =
         std::make_unique<NiceMock<TriggerFactoryMock>>();
     TriggerFactoryMock& triggerFactoryMock = *triggerFactoryMockPtr;
@@ -36,14 +40,14 @@
         std::make_unique<NiceMock<TriggerMock>>(triggerParams.name());
     TriggerMock& triggerMock = *triggerMockPtr;
     std::unique_ptr<TriggerManager> sut = std::make_unique<TriggerManager>(
-        std::move(triggerFactoryMockPtr),
+        std::move(triggerFactoryMockPtr), std::move(storageMockPtr),
         std::move(DbusEnvironment::getObjServer()));
     MockFunction<void(std::string)> checkPoint;
 };
 
 TEST_F(TestTriggerManager, addTrigger)
 {
-    triggerFactoryMock.expectMake(triggerParams, Ref(*sut))
+    triggerFactoryMock.expectMake(triggerParams, Ref(*sut), Ref(storageMock))
         .WillOnce(Return(ByMove(std::move(triggerMockPtr))));
 
     auto [ec, path] = addTrigger(triggerParams);
@@ -83,7 +87,7 @@
 
 TEST_F(TestTriggerManager, DISABLED_failToAddTriggerTwice)
 {
-    triggerFactoryMock.expectMake(triggerParams, Ref(*sut))
+    triggerFactoryMock.expectMake(triggerParams, Ref(*sut), Ref(storageMock))
         .WillOnce(Return(ByMove(std::move(triggerMockPtr))));
 
     addTrigger(triggerParams);
@@ -95,7 +99,7 @@
 
 TEST_F(TestTriggerManager, DISABLED_failToAddTriggerWhenMaxTriggerIsReached)
 {
-    triggerFactoryMock.expectMake(std::nullopt, Ref(*sut))
+    triggerFactoryMock.expectMake(std::nullopt, Ref(*sut), Ref(storageMock))
         .Times(TriggerManager::maxTriggers);
 
     for (size_t i = 0; i < TriggerManager::maxTriggers; i++)
@@ -117,7 +121,8 @@
 {
     {
         InSequence seq;
-        triggerFactoryMock.expectMake(triggerParams, Ref(*sut))
+        triggerFactoryMock
+            .expectMake(triggerParams, Ref(*sut), Ref(storageMock))
             .WillOnce(Return(ByMove(std::move(triggerMockPtr))));
         EXPECT_CALL(triggerMock, Die());
         EXPECT_CALL(checkPoint, Call("end"));
@@ -144,7 +149,8 @@
 {
     {
         InSequence seq;
-        triggerFactoryMock.expectMake(triggerParams, Ref(*sut))
+        triggerFactoryMock
+            .expectMake(triggerParams, Ref(*sut), Ref(storageMock))
             .WillOnce(Return(ByMove(std::move(triggerMockPtr))));
         EXPECT_CALL(triggerMock, Die());
         EXPECT_CALL(checkPoint, Call("end"));
