Creating a custom rule to validate item fields