If you’ve built a custom UI for Salesforce, you can use Use the Salesforce Object Query Language (SOQL) to search your Salesforce data for specific information.
Description
Excerpt |
---|
Returns all the results in a single response as a json string, or if needed, returns part of the results and an identifier used to retrieve the remaining results. |
Is the equivalent of
...
a Select SQL statement or the analog of the Jira JQL. This search enables you to get the list of information about Salesforce objects in a json format (not the value or object directly) which you can use to fill out fields in Jira using a script.
SOQL supports get functionality with attachments and statuses.
Syntax
sfdcQuery(sfdcConnection, soqlQuery, [sfdcAPIVersion])
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
sfdcConnection | Yes | Salesforce Connection - it is the object resulted from the call to the connectToSalesforce routine. | |
sfdcQuery | string | Yes | SOQL query, see more information in the Salesforce documentation. |
sfdcAPIVersion | string | No | Salesforce API version to be called when creating the account, it should have the following form: "vXX.X" - eg: "v43.0", "v42.0". It is not required and if empty the latest available version will be used. |
Return type
JSON string
Example
The first part of the example will get the names of the accounts from Salesforce and the second part will get ID and names of the Salesforce opportunities.
Code Block |
---|
SFDCConnection conn = connectToSalesforce("SFDC_test");
logPrint("WARN", "Connected to SF: " + conn.instance_url + " - " + conn.access_token);
string result = sfdcQuery(conn, "SELECT name from Account");
logPrint("WARN", "SOQL result: " + result);
string result2 = sfdcQuery(conn, "SELECT id, name from Opportunity");
logPrint("WARN", "SOQL result: " + result2); |
See also
Filter by label (Content by label) | ||||||||
---|---|---|---|---|---|---|---|---|
|