Viewing Workplans in Reporting API
An Audit has one or more Work Plans. As the Work Plan is the child record to Audit, in order to query via the API you cannot start from the Audit perspective, it is necessary to start at the Workplan and ‘work up’.
For example, here we see an Audit and its four Work Plans:
You can query from the workplan perspective to find information about the individual workplan signoffs as well as the parent Audit (per the data grid in the example above):
https://server.domain.com/PentanaPRD/API/query/workplan?select=name,audit.name,audit.period.name,audit.manager.name,approval.createdtime,approval.createdby.name&where=audit.name%20like%20"My%20Test%20Audit"
Returns:
[{'id': 173, 'name': '0.3 - Audit Reporting', 'audit': {'id': 40, 'name': '2020-01 - My Test Audit', 'period': {'id': 11, 'name': '2020'}, 'manager': {'id': 5, 'name': 'Terry Perkins'}}, 'approval': {'id': 637, 'createdtime': '9/5/2022 12:22:47 PM', 'createdby': {'id': 12, 'name': 'Stephen Jupp'}}}, {'id': 174, 'name': '0.4 - Audit Sign-Off', 'audit': {'id': 40, 'name': '2020-01 - My Test Audit', 'period': {'id': 11, 'name': '2020'}, 'manager': {'id': 5, 'name': 'Terry Perkins'}}, 'approval': {'id': 646, 'createdtime': '9/5/2022 12:22:47 PM', 'createdby': {'id': 12, 'name': 'Stephen Jupp'}}}, {'id': 175, 'name': '0.1 - Audit Planning', 'audit': {'id': 40, 'name': '2020-01 - My Test Audit', 'period': {'id': 11, 'name': '2020'}, 'manager': {'id': 5, 'name': 'Terry Perkins'}}, 'approval': {'id': 620, 'createdtime': '9/5/2022 12:22:47 PM', 'createdby': {'id': 12, 'name': 'Stephen Jupp'}}}, {'id': 176, 'name': '0.2 - Initial Risk and Controls Assessment', 'audit': {'id': 40, 'name': '2020-01 - My Test Audit', 'period': {'id': 11, 'name': '2020'}, 'manager': {'id': 5, 'name': 'Terry Perkins'}}, 'approval': {'id': 629, 'createdtime': '9/5/2022 12:22:47 PM', 'createdby': {'id': 12, 'name': 'Stephen Jupp'}}}]