Search code examples
xmltaleotaleo-connect-client

Retrieve accepted offers from last week in Taleo


I have a Taleo Client Connect export which retrieves offers from Taleo Recruiting 17.4. I want to filter my results to only include offers that were accepted within the past seven days.

My filter works if I manually specify a date in the XML data, but I can't figure out how to calculate last week's date at runtime.

<quer:filtering xmlns:quer="http://www.taleo.com/ws/integration/query">
  <quer:greaterThan>
    <quer:field path="AcceptedDate"/>
    <quer:date>2019-02-22</quer:date> <!--Should equal [CURRENT_DATE]-[7_DAYS]-->
  </quer:greaterThan>
</quer:filtering>

How can I export offers that were accepted within the past week using Taleo Connect Client?


Full export:

<quer:query productCode="RC1704" model="http://www.taleo.com/ws/tee800/2009/01" projectedClass="Offer" locale="en" mode="CSV" csvheader="true" largegraph="true" preventDuplicates="false" xmlns:quer="http://www.taleo.com/ws/integration/query">
  <quer:subQueries/>
  <quer:projections>
    <quer:projection>
      <quer:field path="AcceptedDate"/>
    </quer:projection>
    <quer:projection>
      <quer:field path="Application,Candidate,Number"/>
    </quer:projection>
    <quer:projection>
      <quer:field path="Application,Requisition,ContestNumber"/>
    </quer:projection>
  </quer:projections>
  <quer:projectionFilterings/>
  <quer:filterings>
    <quer:filtering>
      <quer:greaterThan>
        <quer:field path="AcceptedDate"/>
        <quer:date>2019-02-22</quer:date> <!--Should equal [CURRENT_DATE]-[7_DAYS]-->
      </quer:greaterThan>
    </quer:filtering>
  </quer:filterings>
  <quer:sortings/>
  <quer:sortingFilterings/>
  <quer:groupings/>
  <quer:joinings/>
</quer:query>

Solution

  • Try this complex filter:

    <quer:filtering xmlns:quer="http://www.taleo.com/ws/integration/query">
        <quer:greaterThan>
            <quer:field path="AcceptedDate"/>
            <quer:castAsDate>
                <quer:addDays>
                    <quer:date type="now"/>
                    <quer:integer>-7</quer:integer>
                </quer:addDays>
            </quer:castAsDate>
        </quer:greaterThan>
    </quer:filtering>