Skip to main content
Version: V2 (Ignition 8.1)

system.mes.shift.getShiftsByLocation

Description​

Retrieves Shifts records for the specified location.

Permissions​

This method requires the SHIFT.READ.GET permission.

Syntax​

system.mes.shift.getShiftsByLocation(locationIdOrPath)
system.mes.shift.getShiftsByLocation(locationIdOrPath, includeDisabled)

Parameters​

Method 1: With Location Only​

ParameterTypeNullableDescription
locationIdOrPathStringFalseThe location ID or path to find shifts for.

Method 2: With Include Disabled Flag​

ParameterTypeNullableDescription
locationIdOrPathStringFalseThe location ID or path to find shifts for.
includeDisabledBooleanTrueWhether to include disabled records. If null/omitted, defaults to false.

Returns​

Returns a list of JSON objects representing the shifts found for the location.

Code Examples​

# Retrieve shifts for a location (enabled only)
shifts = system.mes.shift.getShiftsByLocation('DairyCo/Plant1/Line1')
print(shifts)

# Retrieve shifts for a location including disabled
allShifts = system.mes.shift.getShiftsByLocation('DairyCo/Plant1/Line1', True)
print(allShifts)