I have an engagement plan and there are number of contacts in each state.
How can I programmatically obtain list of contacts which are in specific engagement plan state by state ID?
Have just found a method:
var pageableContactIds = AutomationManager.Provider.GetEnrolledContactsIdsByStatePaged(engagementPlanStateId);
This will return an object of type Sitecore.Common.IPageable<ID>
which provides a method .GetAll()
Seems to work for me.