Viewing Milestones in Reporting API
To view the current milestone for a given audit in the Internal Audit application, you can view the Current Milestone field in the properties panel or add the field to the grid, e.g.:
Reporting in the API, you can get this field from the audit perspective, e.g. https://server.domain.com/PentanaPRD/API/query/audit?select=name,currentmilestone.name&where=name%20like%20"Head%20Office"
Returns:
[{'id': 1, 'name': '01 - Head Office Accounts Payable', 'currentmilestone': {'id': 2, 'name': 'Issue Report'}}]
View all mapped Audit Milestones for an Audit
It is also possible to view all mapped Audit Milestones for a given Audit via the API by drilling down into startmilestone, reportmilestone and endmilestone from the Audit perspective.
For example, here '01 - Head Office Accounts Payable' has planned and actual values for start and report milestones, and an End Planned Date:
From the Audit perspective, you can use the Reference tool to drill down into each milestone type to obtain the required fields:
i.e. selecting any or all of:
startmilestone.planneddate
startmilestone.actualdate
reportmilestone.planneddate
reportmilestone.actualdate
endmilestone.planneddate
endmilestone.actualdate
For example, bringing back all milestone dates:
This returns:
[{'id': 1, 'name': '01 - Head Office Accounts Payable', 'startmilestone': {'id': 1, 'planneddate': '20220606', 'actualdate': '20220607'}, 'reportmilestone': {'id': 2, 'planneddate': '20220908', 'actualdate': '20220918'}, 'endmilestone': {'id': 3, 'planneddate': '20220909', 'actualdate': ''}}]
View all Milestones for an Audit
From the Audit perspective you can see only the mapped Milestones. If you have added Milestones to the Library then in order to query for all Milestones you should start from the auditmilestone perspective.
For example, where there are additional Milestones in the Library:
. . . And these are brought in to the Audit:
. . . then a query such as this will return the entire set of Milestones for that Audit:
This returns:
[{'id': 1, 'audit': {'id': 1, 'name': '01 - Head Office Accounts Payable'}, 'milestone': {'id': 1, 'name': 'Start Audit'}, 'planneddate': '20220601', 'actualdate': '20220701'}, {'id': 2, 'audit': {'id': 1, 'name': '01 - Head Office Accounts Payable'}, 'milestone': {'id': 2, 'name': 'Issue Report'}, 'planneddate': '20220901', 'actualdate': '20221001'}, {'id': 3, 'audit': {'id': 1, 'name': '01 - Head Office Accounts Payable'}, 'milestone': {'id': 3, 'name': 'End Audit'}, 'planneddate': '20221001', 'actualdate': '20221101'}, {'id': 118, 'audit': {'id': 1, 'name': '01 - Head Office Accounts Payable'}, 'milestone': {'id': 4, 'name': 'Test Milestone 1'}, 'planneddate': '20220801', 'actualdate': '20220801'}, {'id': 119, 'audit': {'id': 1, 'name': '01 - Head Office Accounts Payable'}, 'milestone': {'id': 5, 'name': 'Test Milestone 2'}, 'planneddate': '20220801', 'actualdate': '20220901'}]