unee-t / frontend

Meteor front end

Home Page:https://case.dev.unee-t.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Transform Dashboard query into BZ API call

franck-boullier opened this issue · comments

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

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)

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

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:

  • startDate
  • endDate
  • userApiKey

@nbiton

  • Can you give me an example of the format for startDate and endDate
  • The userApiKey is NOT the same as the MEFE user API key correct?

Thanks

startDate/endDate:

  • Any date in the format of yyyy-mm-dd, such as "2019-04-30"
  • Relative date expressions, such as the ones used for querying BZ with its search form: "-1d", "now", "-2w", "-3m"

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