Skip to end of banner
Go to start of banner

Making sophisticated queries with JQL

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

The Connector provides a JQL function for advanced users to make sophisticated queries for issues in Jira based on the remote objects that issues are associated with.

The function will determine which connection to query if you have multiple connections configured in your system.

For example, if you run a query on a Salesforce object, the lookup will take place for the Salesforce connection it is configured for.

Syntax

remoteObjects(field, value) OR
remoteObjects(field1, comparator1, value1, field2, comparator2, value2, ...)

The first syntax style is used for quick queries and defaults to a comparator of "LIKE".

The second syntax style is for more complex queries with other comparators and multiple "AND" conditions. If you want to build your query using multiple "OR" conditions, you can make use of the in-built JQL feature to "OR" multiple queries using the "remoteObjects" function.

See the Examples section for examples of each case.

Supported fields

For a list of field names within a Salesforce object, please see the Salesforce Standard Objects documentation.

Supported Salesforce comparators

=

!=

>

>=

<

<=

IN

NOT IN

LIKE

~

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

For more information on the supported comparators, view the Atlassian Documentation on Advanced searching - operators reference.

Date Field Expressions

If comparing to specific dates, Salesforce is very particular about the format of the date string.

See: Date Formats and Date Literals on Salesforce.

Examples

These examples feature custom field names that are auto-generated when you create new mappings.

Find issues associated with Salesforce Users with an email address ending with "servicerocket.com"

"Salesforce User Reference" in remoteObjects("Email", "like", "servicerocket.com")

Find issues associated with Salesforce Cases related to "Acme Company"

"Salesforce Case Reference" in remoteObjects("Account.Name", "Acme Company")

Find issues associated with Salesforce Opportunity amount values between "10000" and "50000"

"Salesforce Opportunity Reference" in remoteObjects("Amount", ">", "10000", "Amount", "<", "50000")

Find issues associated with Salesforce Opportunities with a close date before, and including, 31st December 2011

"Salesforce Opportunity Reference" in remoteObjects("CloseDate", "<=", "2011-12-31")

Find issues associated with Salesforce Cases owned by "Fred Smith" or "Jane Doe"

"Salesforce Case Reference" in remoteObjects("Owner", "Fred Smith") OR "Salesforce Case" in remoteObjects("Owner", "Jane Doe")
  • No labels