0

I am looking to have a SOQL query for the following scenarios?

  1. How to fetch the list of Milestone under the Entitlement Process of the Entitlement using Entitlement Name ?
  2. Using CaseId fetch the Name Of the Milestones??

[SELECT Id, Name FROM MilestoneType where Id IN (SELECT MilestoneTypeId FROM CaseMilestone WHERE CaseId = '')]

1 Answer 1

1
  1. How to fetch the list of Milestone under the Entitlement Process of the Entitlement using Entitlement Name ?

You need to use Metadata API to fetch list of milestones under Entitlement process.

From Entitlement Name you can get SLAProcessId, which Entitlement Process Id through SOQL query.

SELECT SlaProcessId FROM Entitlement WHERE Name = '<Entitlement Name>';

Refer EntitlementProcess Metadata API which has milestones field referred to EntitlementProcessMilestoneItem and from there you can fetch milestoneName.

  1. Using CaseId fetch the Name Of the Milestones??

This SOQL I have given you earlier perfectly works for me.

[SELECT Id, Name FROM MilestoneType 
WHERE Id IN 
(SELECT MilestoneTypeId 
FROM CaseMilestone 
WHERE CaseId = '')]

You must log in to answer this question.