Skip to content

Best way to do Or queries ?  #17

@ajmyers01

Description

@ajmyers01

I want to pull back all tImeEntry records that have a type of 1 or 2. how would i go about constructing that using an add_condition block ?

query = AutotaskAPI::QueryXML.new do |query|
query.entity = 'timeentry'
end

year_ago = (DateTime.now - 1.year).to_formatted_s(:iso8601)                                                                                             
query.add_condition('ticketid', 'equals', ticket_id)                                                                                                        

query.add_condition('type', 'equals', 2)  || query.add_condition('type', 'equals', 1) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions