Is it possible to change the Dashboard owner name using Scheduled Job?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2022 02:24 AM
Hi Experts,
I need to change the Dashboard owner name using scheduled job. not by manually or by some other method
Kindly help me on how can I achieve this.
Thanks in advance
Chaithra
- Labels:
-
Cost Management (ITSM)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2022 02:35 AM
You can navigate to Dashboard (pa_dashboards) table & update it from List View.
If you still need a job or so yes it is possible you need to GlideRecord Dashboard (pa_dashboards) table & update owner accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2022 03:12 AM
Hi
Thanks for the reply.
I have tried the below code in Fix script it is working there. But when I tried to implement it in scheduled job It is not working.
var gr = new GlideRecord('pa_dashboards');
///gr.addEncodedQuery('name=test');
gr.addEncodedQuery('sys_id=03af95f81b9d67XXXXX943d9c979f1d4bcbfa');//sys_id ofdashboard
gr.query();
while(gr.next()){
gr.owner = 'XXXXX';// user_name
gr.setWorkflow(false);
gr.autoSysFields(false);
gr.update();
}
Thanks,
Chaithra

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2022 03:58 AM
Should work. Can you try executing the code in Schduled job using 'Execute now' button.
Additionally, what is Run As set for the scheduled job.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2022 04:11 AM