🛒 More SmartTasks
👍 Tested to be working with R81.20+
SmartTask to check if object or rule comments are left blank by SmartConsole admins.
Script code
Copy the code below into a new script 'Task_CheckComments' of your SmartConsole script repository.
test `cat $1|grep -iqE 'implied|automatic|\"last-modifier\":\"System\"'; echo $?` -eq 0 && echo '{"result":"success"}' || { test `(cat $1 | jq -r '.operations["added-objects"][]?.comments'; cat $1 | jq -r '.operations["modified-objects"][] | .["new-object"].comments') | grep -c '^[[:space:]]*$'` -gt 0 && echo '{"result":"failure","message":"Comments on rules and objects must not be blank!"}' || echo '{"result":"success"}'; }
SmartTask
Create a new SmartTask in SmartConsole > Manage & Settings > SmartTasks and install policy to activate the new task.
| Name |
Description |
Trigger |
Action |
Enabled |
| Detect Blank Comments |
Check for blank comments in added or modified objects and rules. |
Before Publish |
Run Script |
✔️ |