Getting different results from filter using VBA

Hey guys, 

I have created a filter in Jira that will bring me all the issues that were created on an specific week. Something like this....

project = TEST AND issuetype = Bug AND created >= startOfWeek(-12) AND created <= endOfWeek(-12) 

What i'm doing is that I'm building a report in Excel using VBA to call the REST services to run that filter, with its ID, and get the count of issues from that specific filter and add those into a cell. 

The problem is that I'm getting different results from the filter. If I use it in Jira, I'm getting "n" issues, and when using the REST services in VBA, I'm getting something different than "n". 

I realized that it has something to do with the functions of "startOfWeek" and "endOfWeek". Jira is interpreting the end of week as Saturday (which is what I want) but Excel/VBA is interpreting the end of week as Sunday. So, that's why I'm getting a misscount, any ideas on how to fix this in VBA? 

 

Thanks!

1 answer

Hey Alejandro,

In VBA you're able to set the start of the week using the weekday() function. I think this link here does a good job of explaining it.

https://www.techonthenet.com/excel/formulas/weekday.php

Hey Brandt!

Thanks for the response, but the problem is that I'm not using Excel to calculate the week, I'm just running the filter that does that.

.Open "GET", "https://TEST.atlassian.net/rest/api/2/search?jql=filter=12345", False
.SetRequestHeader "Content-Type", "application/json"
.SetRequestHeader "Accept", "application/json"
.Send

And then, from the response, I just take the "total" node. 

If I make the call through Postman or cURL or whatever ... I'm getting the actual result I want. But when calling it from VBA with the above code, I'm getting this missmatch. 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Wednesday in Jira

Join our webinar: How 1B+ feature flag events helped us build the new Jira

Every time you release software, there's a bit of risk – that there's a bug, that something breaks, or that the feature doesn't resonate with customers. Feature flagging helps make high stakes s...

91 views 0 1
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you