I want to show closed issues. But i got 2 jql query. One is for issue from start of the month till now.
For example we are in 15.06 we need this for second jql. And second jql the most hard for me to understand is issues from the past month but the same day as current month so for example today is 15.06 and i need to see from 01.05 to 15.05 of the previous month. And it should be dynamic so the next day 16.06 i want to see previous month from 01.05 to 16.05 and so on.
This is tricky. You can start a JQL search with date >= startOfMonth(-1) to get the 01.05 part, but I'm not sure how you'd go about getting the 16.05 part. You can hard code dates in the JQL like created >= '2021-05-01' and created <= '2021-05-15 23:59', but I know you don't want to do that, since you'd have to change it every day.
<a id="last_month_issues">Jira Issues - Last Month Through Current Day</a>
var today = new Date();
var thisMonth = today.getMonth(); // 0=January
var thisDay = today.getDate();
var thisYear = today.getYear(); // Number of years since 1900 (e.g. 2021 = 121)
if(thisMonth == 0)
lastMonth = 11;
lastMonthYear = thisYear - 1;
lastMonth = thisMonth - 1;
lastMonthYear = thisYear;
lastMonth += 1;
lastMonthYear += 1900;
var myJira = "https://YOURJIRA"
var field = "created" // whichever field you wish to check
var link = myJira + "/issues/?jql=" + field + "%20>%3D%20%27" + lastMonthYear + "-" + String(lastMonth).padStart(2,'0') + "-01%27%20and%20" + field + "%20<%3D%20%27"+String(lastMonthYear).padStart(2,'0') + "-" + String(lastMonth).padStart(2,'0') + "-" + String(thisDay).padStart(2,'0') + "%2023%3A59%27";
document.getElementById("last_month_issues").href = link;
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events