{ "rules_set_stock_value" : { "LABEL" : "Set Stock Value", "PLUGIN" : "rule", "REQUIRES" : [ "rules" ], "USES VARIABLES" : { "product" : { "label" : "Product", "type" : "commerce_product" }, "new_stock_value" : { "label" : "New Stock Value", "type" : "integer" } }, "IF" : [ { "entity_has_field" : { "entity" : [ "product" ], "field" : "commerce_stock" } } ], "DO" : [ { "data_set" : { "data" : [ "product:commerce-stock" ], "value" : [ "new-stock-value" ] } } ] } }