I’m not sure why this gives me issues every time but I figured I’d put it here so I can find it next time I need it:
<quer:projection alias="CSWMotive" xmlns:quer="http://www.taleo.com/ws/integration/query">
<quer:query projectedClass="Application" alias="sqMotives" preventDuplicates="true" pagingsize="1">
<quer:projections>
<quer:projection alias="Motive">
<quer:field path="ProfileInformation,HistoryItems,ApplicationTrackingCSWItem.CSWMotives,Mnemonic"/>
</quer:projection>
</quer:projections>
<quer:filterings>
<quer:filtering>
<quer:equal>
<quer:field path="Number"/>
<quer:field ownerQuery="MainQuery" path="Number"/>
</quer:equal>
</quer:filtering>
<quer:filtering>
<quer:equal>
<quer:field path="ProfileInformation,HistoryItems,ApplicationTrackingCSWItem.Step,Mnemonic"/>
<quer:field ownerQuery="MainQuery" path="CSWLatestStep,Mnemonic"/>
</quer:equal>
</quer:filtering>
<quer:filtering>
<quer:equal>
<quer:field path="ProfileInformation,HistoryItems,ApplicationTrackingCSWItem.Status,Mnemonic"/>
<quer:field ownerQuery="MainQuery" path="CSWLatestStatus,Mnemonic"/>
</quer:equal>
</quer:filtering>
<quer:filtering>
<quer:equal>
<quer:field path="ProfileInformation,HistoryItems,ApplicationTrackingCSWItem.Reverted"/>
<quer:boolean>false</quer:boolean>
</quer:equal>
</quer:filtering>
<quer:filtering>
<quer:equal>
<quer:field path="Candidate,History,ApplicationTrackingCSWItem.Step,Mnemonic"/>
<quer:string>step_mnemonic</quer:string>
</quer:equal>
</quer:filtering>
<quer:filtering>
<quer:equal>
<quer:field path="Candidate,History,ApplicationTrackingCSWItem.Status,Mnemonic"/>
<quer:string>status_mnemonic</quer:string>
</quer:equal>
</quer:filtering>
</quer:filterings>
</quer:query>
</quer:projection>