Skip to content
This repository was archived by the owner on Nov 29, 2017. It is now read-only.

Multi-Queries - #6

Closed
mrosales wants to merge 3 commits into
YaleSTC:masterfrom
mrosales:multi-queries
Closed

Multi-Queries#6
mrosales wants to merge 3 commits into
YaleSTC:masterfrom
mrosales:multi-queries

Conversation

@mrosales

@mrosales mrosales commented Dec 1, 2014

Copy link
Copy Markdown

Modified Incident.where to accept an array of hashes as well as just a single hash. When an array is specified, it joins all of the individual hash queries with ORs and then returns an array of incidents matching the entire query.

Also added a couple macros for incident state.
Can now use is_closed?, is_resolved? and is_open? on incident objects

Queries can now be either arrays or hashes. If the query is an
array, all of the children must be hashes, and the query will
be the result of joining all of the children with "^OR".
Code checks for an incident with empty attributes to denote failure,
but the constructor failed instead. This caused errors whenever a
query returned no results. Now works as intended
Can use `is_closed?`, `is_resolved?` and `is_open?` to
determine the state of an incident
@caseywatts

Copy link
Copy Markdown
Contributor

Thanks Micah!

  1. Could you see if @dmfranko 's code in More flexible way of querying against ServiceNow #5 does something similar?
  2. Could you pull out the is_closed? stuff into a separate pull request?

@dmfranko

dmfranko commented Dec 4, 2014

Copy link
Copy Markdown

Let me know if you need any help in terms of ServiceNow capabilities and how to pull data out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants