REST API Explorer - query joining two tables

suprabha
Kilo Explorer

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?

14 REPLIES 14

Tony Chatfield1
Kilo Patron

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.

 

suprabha
Kilo Explorer

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

@suprabha 

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

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.