I am trying to figure out how long a ticket has been in a certain status. I am sure it is something simple that I am missing..
Here is what I have so far:
project = XXXX ssuetype in standardIssueTypes() AND status in (Open, "In Progress", "On Hold", Intake, New, "HLE Estimate", "HLE Proposed", "HLE Approved", "DLE Estimate", "DLE Proposed", "DLE Approved", "DLE Reviewed", "HLE Reviewed") AND created >= 2021-01-01 AND created <= 2023-02-28 ORDER BY created DESC
Can anyone help me find the time in the current status?
I found something that worked. Hopefully this will help someone else.
project = XXXXX AND (status changed to "A_Estimate" before -30d AND status changed to "A Estimate" AFTER -60d AND status = "A Estimate") OR (status changed to "B Estimate" before -30d AND status changed to "B Estimate" AFTER -60d AND status = "B Estimate")
HI @Lisa Stewart ,
here is the code concept:
WITH CTE_BASE
as
(
SELECT
p.pname,
p.pkey,
i.issuenum,
cg.ID,
cg.issueid,
au.lower_user_name,
cg.AUTHOR,
cg.CREATED,
ci.FIELDTYPE,
ci.FIELD,
ci.OLDVALUE,
ci.OLDSTRING,
ci.NEWVALUE,
ci.NEWSTRING,
ROW_NUMBER() over (
partition by p.pkey, i.issuenum
order by cg.created asc
) as sequence_flowFROM changegroup cg inner join jiraissue i on cg.issueid = i.id inner join project p on i.project = p.id inner join changeitem ci on ci.groupid = cg.id AND ci.FIELDTYPE='jira' AND ci.FIELD='status' inner join app_user au on cg.author = au.user_key WHERE cg.issueid=(select id from jiraissue where issuenum = 115 and project in (select id from project where pname = 'Project name')) order by 1,3,4
)
SELECT
t1.*,
CAST(DATEDIFF(SECOND, t2.created, t1.created) / 86400 as varchar(10)) + ' days ' +
CAST((DATEDIFF(SECOND, t2.created, t1.created) % 86400) / 3600 AS VARCHAR(10)) + ' hours ' +
CAST(((DATEDIFF(SECOND, t2.created, t1.created) % 86400) % 3600) / 60 AS VARCHAR(10)) + ' minutes ' +
CAST(((DATEDIFF(SECOND, t2.created, t1.created) % 86400) % 3600) % 60 AS VARCHAR(10)) + ' seconds' as Durantion_in_STATUS
FROM CTE_BASE t1
left JOIN CTE_BASE t2 ON (t1.sequence_flow = (t2.sequence_flow + 1) and t1.pkey = t2.pkey and t1.issuenum = t2.issuenum)
order by 2,3,8 asc
Hope this helps.
Just change the issue number in the where clause in CTE_BASE as well as the project name in the where clause
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can query the database with the following SQL statement to find out for how long the issues has been in the current status:
SELECT
NOW() - cg.created "time_in_status"
FROM
jiraissue i
JOIN project p ON p.id = i.project
JOIN changegroup cg ON cg.issueid = i.id
JOIN changeitem ci ON ci.groupid = cg.id AND ci.field = 'status'
WHERE
p.pkey = 'ABC'
AND i.issuenum = 123
ORDER BY cg.created DESC
LIMIT 1
Replace ABC with your project key and 123 with the issuenumber.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As mentioned by everyone, an app will help solve this use case.
If you would be interested in the same, you can try out our plugin,
Agile Tools : Epic Tree, Links Tree, Time in Status & Worklogs
The add-on provides the time in each status. There are multiple other reports which help in tracking the complete life cycle of the issues.
Disclaimer : I work for RVS, the vendor for this app.
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.
Hello @Lisa Stewart
Jira does not have an out-of-the-box report that shows individual status times. If you are interested in overall resolution times, Issue Age Report or Control Chart (of Kanban Boards) might be useful up to a degree. It is worth noting that these options offer limited details and limited flexibility.
In fact, the raw data needed to create such a report is available in the History tab of each issue but it is hard to turn these into a ready-to-use report.
For a ready-to-use report, the use of a marketplace app is needed.
If you are OK with using a marketplace app for this, our team at OBSS built Time in Status for this exact need. It is available for Jira Server, Cloud, and Data Center.
Time in Status mainly allows you to see how much time each issue spent on each status and on each assignee.
The app has Consolidated Columns feature. This feature allows you to combine the duration for multiple statuses into a single column and exclude unwanted ones. It is the most flexible way to get any measurement you might want. Measurements like Issue Age, Cycle Time, Lead Time, Resolution Time etc.
For all numeric report types, you can calculate averages and sums of those durations grouped by the issue fields you select. For example total in-progress time per customer (organization) or average resolution time per sprint, week, month, issuetype, request type, etc. The ability to group by parts of dates (year, month, week, day, hour) or sprints is particularly useful here since it allows you to compare different time periods or see the trend.
The app calculates its reports using already existing Jira issue histories so when you install the app, you don't need to add anything to your issue workflows and you can get reports on your past issues as well. It supports both Company Managed and Team Managed projects.
Time in Status reports can be accessed through its own reporting page, dashboard gadgets, and issue view screen tabs. All these options can provide both calculated data tables and charts.
And the app has a REST API so you can get the reports from Jira UI or via REST.
Using Time in Status you can:
https://marketplace.atlassian.com/apps/1211756/
EmreT
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you prefer to use a marketplace app, you can try Status Time Reports app developed by our team. It mainly provides reports and gadgets based on how much time passed in each status.
Here is the online demo link, you can see it in action and try without installing the app.
If you are looking for a free solution, you can try the limited version Status Time Free.
Hope it helps.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.