Relative Time Expression to query Servicenow from Grafana

We currently using 10.0.3 version of Grafana Enterprise. I’m playing around the Relative time expression to fulfill a requirement for a Servicenow dashboard. Do we have a relative expression that works to get lets say all the change tickets for this week? In servicenow, we have the option to select a “This week” in the filter which corresponds to 255Estart_dateONThis%2520week%40javascript%3Ags.beginningOfThisWeek()%40javascript%3Ags.endOfThisWeek(). But in Grafana side, this seems to be not available. Do we have any possible workaround / solution to this?

Welcome @auesc

Have you tried now/w ? (see below)

Hi @grant2,

Yes I tried now/w but that doesn’t work based on my requirement. Basically below are some of my filters to query ServiceNow. Right now I’m hardcoding the “dates” to fulfill my requirement. But I would like to have a solution something like. Do we have any workaround in Grafana here?

1.) a relative expression something like Planned start date is “This week”
2.) a relative expresssion something like Planned start date is “starting monday” and Planned start date is “end this coming Sunday”

Create your own variable that has key value. The key is the text the user sees the valuebis what will be used in the actual query. You can carve this var manually ir derived from a csv file or from a database table

Is this some sort of a rest api? Weirdest thing I have ever seen. It literally actually has javacript embedded in there??

apologies for the above. They are the URL actually in servicenow. Im trying to achieve a time expression for Grafana

Totally agree, this will be my last result actually. For now, I was trying to see if there could be a time expression that is really working for something like “beginning of this week” or “End of this week”. So far its only the “@hour@ago@1” expression that works properly.

1 Like