Mustache DATE modifications?

We are trying to create a Web API query to our Cherwell ticketing system to only retrieve records from a certain relative date or days ago, but I am unable to get the Mustache js syntax to give me anything other than the current Date() – is there a guide to using some slightly more advanced js such as:

var ten_days_ago=new Date().setDate(today.getDate()-10)


I can’t help you with a more advanced JS guide, but my advice to you would be to look at a SCOM task that triggers a powershell script which then invokes the REST API. With powershell you have much more control over your data and what is being displayed as opposed to the Web API tile. I had a similar issue where I had to show data from x amount of days, and ended up using a SCOM task to fix this.



It seems like we are so close with a JS solution since everything else on the Web API dashboard works perfectly, I’d hate to switch to a script for this one function. I’ll keep digging!