Similar topic is discussed here. You can use replaceIn as well like,
pm.test(pm.variables.replaceIn("Response body contains the ID as {{LeadID}}"), function () {
var jsonData = pm.response.json();
pm.expect(jsonData.Id).to.eql(pm.environment.get("LeadID"));
});