Execute MQL API
MQL
MQL is Mingle's SQL-like query language. Execute MQL API allows you to use MQL queries via the API.
We recommend that you familiarize yourself with some MQL before using it via the API. Click here to learn more about MQL.
Structure of the MQL result resource
Unlike other APIs the structure of what is returned in a result resource will differ depending on what MQL is specified in the request.
In general the structure will reflect the properties that were requested in the MQL. For example, if you select for number and name the results returned will have the attributes number and name.
Using Execute MQL to get a specific set of properties for a specific set cards
Reference
Request Method: GET
URL: /api/v2/projects/project_identifier/cards/execute_mql.xml
mql: MQL select statement. String.
Example
GET
http://localhost:8080/api/v2/projects/new/cards/execute_mql.xml
mql=SELECT number, name WHERE 'Iteration - Scheduled' = (Current Iteration)
Explanation
The above is an example of a GET request to retrieve a specific set of card where "'Iteration - Scheduled' = (Current Iteration)" from the project with identifier "new". This will return the number and name of cards that match the MQL conditions supplied.
Result
If you were authorized to perform the operation, and the operation succeeded, you will be returned an array of results resources.
<results type="array">
<result>
<number>77</number>
<name>Whitespace created when just checking properties</name>
</result>
<result>
<number>74</number>
<name>File audit results beginning to outgrow the audit control and cut off text.</name>
</result>
...
</results>
Using Execute MQL to get the results of a value query
Reference
Request Method: GET
URL: /api/v2/projects/project_identifier/cards/execute_mql.xml
mql: MQL select statement. String.
Example
GET
http://localhost:8080/api/v2/projects/new/cards/execute_mql.xml
mql=SELECT COUNT(*) WHERE Type = story
Explanation
The above is an example of a GET request to retrieve a specific value from the project with identifier "new". This will return a count of cards that match the MQL conditions supplied.
Result
If you were authorized to perform the operation, and the operation succeeded, you will be returned a results resource.
<results type="array">
<result>
<count>64</count>
</result>
</results>