Issue #3348322 by kriboogh, based on the patch of rajiv.singh, but reworked against latest code base and refactored code into a service.
Closes #3348322