Skip to content

Stale Tasks Auto-Close #1564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 31, 2024
Merged

Conversation

vamsi0777
Copy link
Contributor

The script identifies tasks that haven’t been updated for a set period, sends reminder notifications to assigned users, and, if still inactive after additional time, automatically closes them. This helps keep task lists current and reduces manual follow-ups.

Deleting duplicate file
The script identifies tasks that haven’t been updated for a set period, sends reminder notifications to assigned users, and, if still inactive after additional time, automatically closes them. This helps keep task lists current and reduces manual follow-ups.
The script identifies tasks that haven’t been updated for a set period, sends reminder notifications to assigned users, and, if still inactive after additional time, automatically closes them. This helps keep task lists current and reduces manual follow-ups.
@SapphicFire SapphicFire self-assigned this Oct 31, 2024
Copy link
Contributor

@SapphicFire SapphicFire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Have incorporated some advice to consider in future submissions

closeGR.addEncodedQuery('sys_updated_onRELATIVELE@dayofweek@ago@' + closeDays);
closeGR.query();
while (closeGR.next()) {
closeGR.state = 3; // Closed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not be the state value for closed on some task extensions. Additionally, you should use setters (i.e. setValue('field',value))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thanks for the suggestions @SapphicFire

reminderGR.addEncodedQuery('sys_updated_onRELATIVELE@dayofweek@ago@' + staleDays);
reminderGR.query();
while (reminderGR.next()) {
gs.eventQueue('task.reminder', reminderGR, reminderGR.assigned_to, staleDays + ' days without update.');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use getters (i.e. getValue('field'))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the advice @SapphicFire

@SapphicFire SapphicFire merged commit 4a04f68 into ServiceNowDevProgram:main Oct 31, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants