I’m stuck trying to get some data from JIRA using Klipfolio. What I need is:
All issues marked as ‘rejected’ in a specific month
How many times each issue was rejected
I’ve tried a couple of queries but they’re not quite giving me what I want. One shows the history for a single issue, and the other counts rejected issues for a project and sprint. But I can’t figure out how to get both the monthly rejected issues and their rejection counts.
Anyone have experience with JIRA Query Language who can point me in the right direction? I’d really appreciate some help on this!
Here’s a dummy code snippet of what I’m trying to achieve:
function getMonthlyRejections(month, year) {
let rejectedIssues = [];
let rejectionCounts = {};
// Query JIRA API here
// Process the data
// Populate rejectedIssues and rejectionCounts
return { rejectedIssues, rejectionCounts };
}
Having worked extensively with JIRA and Klipfolio, I can suggest an approach that might solve your problem. You’ll want to use a combination of JQL and the JIRA REST API. Start with a JQL query to get all issues that were in a ‘Rejected’ state during your specified month:
project = YourProject AND status WAS Rejected DURING (startOfMonth(), endOfMonth())
This will give you the base set of issues. Then, use the JIRA REST API to fetch the changelog for each issue. You can count the number of transitions to ‘Rejected’ in the changelog.
In Klipfolio, you might need to create a custom data source that combines these API calls. It’s a bit complex, but it should give you exactly what you need. Remember to paginate your results if you’re dealing with a large number of issues.
I’ve dealt with similar JIRA data extraction challenges before. One approach that worked for me was combining JQL with the REST API. First, use JQL to fetch the rejected issues:
project = YourProject AND status CHANGED TO Rejected DURING (startOfMonth(), endOfMonth())
Then, for each issue, query the changelog to count status transitions to ‘Rejected’. You’ll need to make multiple API calls, but it gives precise results.
For implementation, consider using a scripting language like Python with the JIRA library. It simplifies API interactions and data processing. Just be mindful of rate limits if you’re dealing with a large number of issues.
Also, caching results can significantly improve performance if you’re running this query frequently. Good luck with your project!