Brano
Brano

Reputation: 11

How to run report of issues in Jira added to specific sprint after specific date?

How can I run report of issues in Jira added to specific sprint after specific date ? Update date won't help as that one gets updated with lots of different actions. Any ideas?

Similarly, any way how to report on issues created in specific project / moved to specific project after specific date ?

Preferably thru Web UI, but JIRA API would be fine too.

Thanks!

Upvotes: 1

Views: 682

Answers (1)

Jiri Klouda
Jiri Klouda

Reputation: 1370

So here is a little script jira-issue-search.sh:

#!/bin/bash

JIRA_USER=your_username
JIRA_PASS=your_password
JIRA_REST=http://jira.tld/rest/api/2

Q=${1?Search Query}
E=${2?Expand fields}

DATA="{\"jql\":\"${Q:q}\",\"validateQuery\":\"true\",\"startAt\":0,\"maxResults\":100,\"expand\":[\"${E:q}\"]}"
curl -s -u ${JIRA_USER}:${JIRA_PASS} -X POST -H "Accept: application/json" -H "Content-Type: application/json" --data "${DATA:q}" ${JIRA_REST}/search | json_xs -f json  -t json-pretty

And you will run it as: jira-issue-search.sh 'Sprint = \"YourSprintName\"' changelog

The resulting json will have array called 'issues', which contains records with fields key and changelog/histories[]/ { items[]/field=Sprint, created > your_date }. I have a bunch of scripts to do queries in json, but you probably want to write that in whatever language you are using.

To answer the second question it depends on how you model projects. If you use jira projects, then issues cannot be moved between them so it is just creation date comparison, but if you use some custom field, you can compare on the field by searching changelog items/field = field_name and items/to = project_name and again compare created in that changelog entry to your_date.

Upvotes: 1

Related Questions