Hello,
I would to get the yesterday date from currentDate.
I need to get a specific hours
With Confluence's macro I try to request on Jira
The request is like : project = "xx" AND created >= "2019-03-04 18:00" AND created <= "2019-03-05 18:00"
So I wrote this but $yesterday is missing:
## @param Project:title=project|type=string|required=true|desc=Key
#set($day2 = $action.dateFormatter.formatGivenString("yyyy-MM-dd 18:00", $content.currentDate))
<ac:macro ac:name="jiraissues">
<ac:parameter ac:name="title">;All Resolved Issues</ac:parameter>
<ac:parameter ac:name="renderMode">static</ac:parameter>
<ac:parameter ac:name="columns">Key,Created,Updated,Assignee,Status</ac:parameter>
<ac:parameter ac:name="url">http://url.fr:8080/sr/jira.issueviews:searchrequest-rss/temp/SearchRequest.xml?jqlQuery=project+%3D+%22$paramProject%22+AND+created+%3E%3D+%22$day2%22</ac:parameter>
</ac:macro>
Thanks for help
Hello there Gwenaël! Great to have you here.
For you to get the yesterday date, we will need to set a variable with the calendar type and then subtract one with the .add method from the date type:
## @noparams
#set ($date=$action.dateFormatter.calendar)
$date.setTime($content.getCurrentDate())
$date.add(6, -1)
yesterday $action.dateFormatter.formatGivenString("yyyy-MM-dd", $date.time) <br>
You will be able to find more details on the add() method here:
Class Calendar - Field Manipulation
With dateFormatter you should be able to format the date as you see fit for your need. Here are some details on dateFormatter:
Let me know if this piece of information helps you!
Excelent !
This is what i wanted.
I have adapted my constraints with Adam Barilak solution for parametrable JQL request.
I have now a powerfull tool to request Jira to fix dates and add variables in reports
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great to know that the code excerpt was useful Gwenaël!
Hope that the documentation also helps you out. If you ever need assistance again, come reach to the Community™!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.