REST API Explorer - query joining two tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2020 01:30 AM
Hi Team,
We have to prepare a table API query joining two tables incident and journal_entry_field to fetch some incidents having entry in journal_entry_field by some specific user on particular date range.
I can able to get the same by database view but that would not work for me as the target system is not accessible to me this time and we can't create any view on same, we can fire the table query from browser/postman only to get expected result.
Can anybody help me on this please?
- Labels:
-
Reporting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2020 01:35 PM
Hi, quering core sytem tables like sys_journal_field table may result in degraded platform performance and I would suggest you review your requirement to see if you can deliver it via a more appropriate source like 'metrics'.
Perhaps you could share your business requirements, so that the forum is in a better position to understand your objective.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2020 10:11 PM
Thanks Tony! for your valuable suggestion.
Let me explain our requirement....
We have a service which is updating certain incidents from servicenow prepod/prod environment by our cloud API call.And the indication is it writes some logs in worknotes of the incidents with current timestamp.
Now we have create a query to fetch those incidents which is updated by our service (from worknotes by user-ourservice and timestamp) for certain date range.
For this what would be best possible solution considering we have very less access into the prepod/prod servicenow environment.
Could you please help?
Thanks,
Suprabha Bishal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2020 10:17 PM
I believe if you create database view then that database view table may not be available in the API.
You can go with the Scripted REST API approach wherein you will receive the incidents range and then get the journal entries and send in the response.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2020 12:44 PM
I would add a new field (or fields) on either incident or task table so that you can populate specific fields with your integration data; if there may be are multiple updates to be tracked I would consider using metrics to create and track this data, if if these updates were milestsones in the task lifecycle an OLA may also be appropriate.