How to join sys_history_line with hr case table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2023 09:52 PM
I want to join sys_history_line with hr case table with lable = state. I am trying below DB view solution but it is not working. Please suggest.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2023 11:05 PM
Hi @Prateek07
As per the ServiceNow docs, it is not recommended to use history lines or history sets for reporting. You can use Audit (sys_audit) table which has the same data as history lines and history sets tables.
Refer the below links for better understanding:
Check this old thread as well:
Regards,
Vasu Cheeli
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2023 12:20 AM
Hi @Vasu ch
i checked the sys_audit table but it doesnt have proper data like case number and the state field old and new values are backend numbers. Any recommendation over it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2023 01:17 AM - edited ‎11-27-2023 01:19 AM
Hi @Vasu ch
I created a database view on combining hr case table and sys_audit table with the where clause attached in the screenshot. I am able to access hr case and audit table as i am admin.
Problem - when i joined the tables it is showing me acl error 'Number of rows removed from this list by Security constraints: 20' and i am not able to see any data on DB View. Idealy when i am able to access tables then those should be accessible in db view also.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2023 02:15 AM
Hi @Prateek07
It is the ACL issue. Check if the non admin user has relevant access to the HR case table and sys_audit table. Also as per the doc, if the system property "glide.security.expander.view.legacy" is set to true, then it seems you need to define the Read ACL explicitly to the database view.
Regards,
Vasu Ch