Skip to content

Add Scheduled Job script to auto-refresh dashboard daily #1590

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

Closed

Conversation

Southpaw09
Copy link
Contributor

  • Created a script to automatically refresh a specified dashboard at 12 AM every day.
  • Implemented functionality to update the last_refreshed field on the target dashboard in pa_dashboards to simulate refresh.
  • Added README.md with setup instructions, script details, and usage notes.

This feature ensures dashboards are refreshed without manual intervention, enhancing data relevance for daily usage.

- Created a script to automatically refresh a specified dashboard at 12 AM every day.
- Implemented functionality to update the `last_refreshed` field on the target dashboard in `pa_dashboards` to simulate refresh.
- Added README.md with setup instructions, script details, and usage notes.

This feature ensures dashboards are refreshed without manual intervention, enhancing data relevance for daily usage.
@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.

Thank you for your contribution. However, it seems that the file changes in this Pull Request are incorrect or invalid. Please review the files you have changed/added and ensure that all modifications are correct, valid, and align with the project’s goals and guidelines. Closing this for now. Once you make additional changes, feel free to re-open this Pull Request or create a new one. This includes a non-existent field and a misunderstanding of how ServiceNow dashboards work

var dashboardGR = new GlideRecord('pa_dashboards');
if (dashboardGR.get(dashboardSysId)) {
// Trigger dashboard refresh by updating a field or simulating a reload
dashboardGR.setValue('last_refreshed', gs.nowDateTime());
Copy link
Contributor

Choose a reason for hiding this comment

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

This field does not exist on W and X instances. Additionally, ServiceNow dashboards load their data on open and can be refreshed through a page. Reports can be run on a schedule for emails

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