CA Service Management

  • 1.  Time Spans in doSelect where clause

    Posted Jul 03, 2015 11:53 AM

    Hello, I would like to use time spans in my doSelect WS query e.g.

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.ca.com/UnicenterServicePlus/ServiceDesk">
       <soapenv:Header/>
       <soapenv:Body>
          <ser:doSelect>
             <sid>12069673</sid>
             <objectType>in</objectType>
             <whereClause>open_date = StartAtTime('PAST_WEEK') AND nb</whereClause>
             <maxRows>-1</maxRows>
             <attributes>
                <!--1 or more repetitions:-->
                <string>id</string>
             </attributes>
          </ser:doSelect>
       </soapenv:Body>
    </soapenv:Envelope>
    

     

    It is sad but each time I get empty results. Nevertheless I would like to get some more information about time spans. As I understand thy are evaluated by some SDM process according to configured schedule. Maybe someone knows where those evaluated values are stored in files, memory or database? Maybe there is some spel method that can be called to get time span values?



  • 2.  Re: Time Spans in doSelect where clause
    Best Answer

    Posted Jul 04, 2015 02:05 PM

    Hey Gutis,

     

    I don't know if you can use time spans in the whereClause of a doSelect but if you used "open_date = StartAtTime('PAST_WEEK')" in a Stored Query you would also get an empty result.


    That's because the StartAtTime('timespan-name') returns a particular second (since Epoch) in time. If you wanted a query that resulted in the tickets that had been opened in the particular time span then it would look like:

     

    open_date > StartAtTime('PAST_WEEK') AND open_date < EndAtTime('PAST_WEEK')


    Cheers,

    Lindsay



  • 3.  Re: Time Spans in doSelect where clause

    Posted Jul 04, 2015 06:05 PM

    Thank you for pointing my obvious mistake. It seems that timespans can be used in webservices,



  • 4.  Re: Time Spans in doSelect where clause

    Posted Jul 04, 2015 06:27 PM

    My pleasure, Gutis. I'm very good at pointing out obvious mistakes (except my own).

     

    I have learned that you can use timespans that way. Thanks for the feedback.

     

    Cheers,

    Lindsay