Discussions

Ask a Question
Back to all

How to find the eligible Employee/Technician list for a new WorkOrder based on WorkZone, Space, or Asset?

Hi everyone,

I’m working with the Corrigo Enterprise REST API and reviewing the Data Model of Entities. I need to determine which Employees/Technicians are eligible to be assigned when creating a WorkOrder. The WorkOrder may be created for a WorkZone, or the input may come from a Space or an Asset/Location. I’d like to understand the correct entity relationships and query approach.

From the entities documentation, I can see:

  • WorkOrder has WorkZone, MainAsset, Customer, Specialty, Employee, Owner, and Assignments (WoAssignment).
  • Space has CustomerId, Asset (Location), WorkZone, and StatusId.
  • Location has ParentId, RootId, TypeId, AssetInfo, etc., but no direct Employee reference.
  • Employee has AccessToAllWorkZones, WorkZones (LinkUserAndWorkZone), Teams (LinkUserAndTeam), Portfolios (LinkUserAndPortfolio), CustomerGroups (LinkUserAndCustomerGroup), Specialties (LinkUserAndSpecialty), Role, etc.
  • WorkZone has Teams (LinkTeamAndWorkZone), Portfolios (LinkPortfolioAndWorkZone), SpecDispatchRules, Responsibilities, OnCallRules, EscalationRules, BizHours, etc.
  • There are link entities such as LinkUserAndWorkZone, LinkUserAndTeam, LinkTeamAndWorkZone, LinkUserAndPortfolio, LinkPortfolioAndWorkZone, LinkUserAndCustomerGroup, and LinkUserAndSpecialty.

My questions are:

  1. If I have a WorkZone, what is the recommended way to query the eligible Employee list? Should I query LinkUserAndWorkZone by WorkZoneId, and also include Employees where AccessToAllWorkZones = true?

  2. If the input is a Space, should I first resolve Space.WorkZone and then use the same WorkZone-based lookup? Does Space.Asset or Space.CustomerId affect eligibility?

  3. If the input is an Asset / Location, how do I determine the owning WorkZone? Is it through WorkZone.Asset, Location.RootId / Location.ParentId, or another relationship? Once the WorkZone is known, is the Employee lookup the same as case 1?

  4. Should the eligible list be a union of direct WorkZone links, Team-based links (LinkUserAndTeam + LinkTeamAndWorkZone), and Portfolio-based links (LinkUserAndPortfolio + LinkPortfolioAndWorkZone)? How should CustomerGroups and Specialties be applied?

  5. How do Specialty, SpecDispatchRule, Responsibility, OnCallRule, and EscalationRule affect or prioritize the assignable Employee list?

  6. Is there an existing Query API sample or Command API operation that returns assignable Employees for a new WorkOrder based on WorkZone/Space/Asset? If not, what is the recommended workaround?

Any sample QueryExpression or guidance would be greatly appreciated.

Thanks!