unee-t / frontend

Meteor front end
https://case.dev.unee-t.com/
GNU Affero General Public License v3.0
9 stars 17 forks source link

Transform Dashboard query into BZ API call #824

Open franck-boullier opened 5 years ago

franck-boullier commented 5 years ago

the problem

How can we convert a search request like this one

https://dashboard.unee-t.com/buglist.cgi?columnlist=product%2Crep_platform%2Ccf_ipi_clust_6_claim_type%2Cshort_desc%2Cpriority%2Cbug_status%2Cresolution%2Ccf_ipi_clust_5_budget%2Ccf_ipi_clust_5_spe_purchase_cost%2Copendate%2Cchangeddate%2Cop_sys&f1=creation_ts&f2=creation_ts&known_name=MTD%20data%20on%20cases&list_id=604287&o1=greaterthaneq&o2=lessthaneq&query_based_on=MTD%20data%20on%20cases&query_format=advanced&v1=2019-01-01&v2=now

into a REST API call that returns JSON

Possible solution:

Using the BZ native Search API to do this

nbiton commented 5 years ago

It looks like we can't use expressions like "now" for dates when we query BZ API. We might have to proxy it via MEFE. (create a dedicated endpoint)

nbiton commented 5 years ago

I don't know why relative time expressions didn't work with my last attempt on the BZ API, but they do now.

nbiton commented 5 years ago

GET https://dashboard.unee-t.com/rest/bug?include_fields=product%2Crep_platform%2Ccf_ipi_clust_6_claim_type%2Cshort_desc%2Cpriority%2Cbug_status%2Cresolution%2Ccf_ipi_clust_5_budget%2Ccf_ipi_clust_5_spe_purchase_cost%2Copendate%2Cchangeddate%2Cop_sys&f1=creation_ts&f2=creation_ts&o1=greaterthaneq&o2=lessthaneq&query_format=advanced&v1=startDate&v2=endDate&api_key=userApiKey Should get the desired result. Please note that the following placeholders will need to be replaced with appropriate values:

franck-boullier commented 5 years ago

@nbiton

Thanks

nbiton commented 5 years ago

startDate/endDate:

userApiKey: It's not the same. The user's BZ API key should be used here