Using Jira server, I have created a custom field that requires a groovy script to calculate duration. Using that field I want to get a time in status for tickets in a jira project, let's say project X. There are several tickets, now in project X, that were in other projects before landing in project X; I only want to extract the time in a status for the time in project X only. Is there a way to do that?
Hi @Saad Haq and welcome to the Atlassian Community! 👋
If you are looking for a better OOTB and user friendly solution try Time In Status data center version.
For this just simply:
With our add-on you will be also able to:
We strive to be the best for you!
You can also book a live demo - we'll show you the application inside out and answer all your questions.
Have a great day 🥳
Hi @Valeriia_Havrylenko_SaaSJet , can this also provide a time in status for the time the ticket was in a specific Jira project? For example, if I have a Jira ticket in the "In Progress" status in Project A for 4 weeks, but then it has moved to Project B, and it has stayed in the "In Progress" status in Project B for 6 weeks. Using this app, can I get the Time In Status for the time that it was in Project B only? I should get 6 weeks and not 10 weeks.
Thanks,
-Saad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Saad Haq Of course. When you choose a project, the task time in the status will be calculated only for the selected project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Saad Haq
Welcome to the community !!
If you would be interested in a readymade solution, you can try out
With our app, you can effortlessly track and visualize how much time your tasks spend in each status, gaining invaluable insights into bottlenecks, efficiency, and team performance. You can generate multiple reports such as:
- time in status for Jira issues with multiple filter options to narrow down you search
- Time with assignee for your issues
- average time issue has been spent in each status
- Status Transition dates of issues
- transition and status count for each issue
- Group your statuses to define your own Cycle/Lead times
Hope this helps.
The app is free for 10 users. Do try it out.
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.
Hi @Amay Purohit_RVS , can this also provide a time in status for the time the ticket was in a specific Jira project? For example, if I have a Jira ticket in the "In Progress" status in Project A for 4 weeks, but then it has moved to Project B, and it has stayed in the "In Progress" status in Project B for 6 weeks. Using this app, can I get the Time In Status for the time that it was in Project B only? I should get 6 weeks and not 10 weeks.
-Saad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Saad Haq
Thanks for your reply. Unfortunately, we do not have a report like "Time in Project". However I have spoken to my dev team and we will add this requirement to our queue and will implement it as per priority.
Thanks
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.
Hi @Saad Haq
Welcome to the community!
Presumably, the script you are creating to calculate the time in status is going to use the issue history to detect all the status changes and their timestamps.
The move operation will also be found in the history.
So it should be possible to filter the history data to only include changes that take place after the issue key (project) was changed.
Somethings along these lines:
import com.atlassian.jira.component.ComponentAccessor
def chm = ComponentAccessor.changeHistoryManager
def issue=Issues.getByKey('ASP-5538')
def projectChanges = chm.getChangeItemsForField(issue, 'project')
def startDate = issue.created
if(projectChanges){
startDate = projectChanges.last().created
}
def statusChanges = chm.getChangeItemsForField(issue, 'status')
statusChanges.findAll{it.created > startDate}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for providing this snippet. If I want to create a filter with this custom field, will this give me the time in status for all Jira tickets, or one jira ticket only?
Also, I have not created a script before, so I am in new territory here. Any additional help would be greatly appreciated.
-Saad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It appears this custom field will be provided by the Jira Misc Custom Field app. I suggest you refer to their documentation for more detailed instructions.
But generally, the way a calculated script would work is that the value is calculated either each time the ticket is accessed or saved. This happens for each ticket where that calculated field is applicable (using custom field context).
And depending on the app, the value is either stored in the database and in the search index, or just in the search index. I'm not sure with JMCF which it is.
This means that JQL search should work to find issues that match a specific value for the custom field (depending on the type of searcher associated with the field).
But that will not work immediately for all historical tickets until you perform a full re-index in order to populate the search index with a value for all those tickets. It will work immediately for all issues created or modified after you roll out the new field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Saad Haq
Welcome to the Atlassian Community!
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. For your case, you can have a look at Time in Status for Each Issue report.
For further details, you can have a look at Status Time Reports How to Videos.
If you are looking for a completely free solution, you can try the limited version Status Time Reports Free.
If you have any questions, feel free to schedule a demo with us.
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.
Can this also provide a time in status for the time the ticket was in a specific Jira project? For example, if I have a Jira ticket in the "In Progress" status in Project A for 4 weeks, but then it has moved to Project B, and it has stayed in the "In Progress" status in Project B for 6 weeks. Using this app, can I get the Time In Status for the time that it was in Project B only? I should get 6 weeks and not 10 weeks.
Thanks,
-Saad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Saad Haq ,
It is possible in one of the two cases below.
Otherwise, it is not possible to differentiate it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Saad Haq ,
Welcome to the community!
Generating a script to obtain this information would be a time-consuming process, as there are already ready-made apps specifically designed for this purpose. So in order to track the time spent on each status I suggest you use a marketplace app. Timepiece (formerly Time in Status) ,the oldest and leading "Time in Status" app in Atlassian Marketplace, which is developed by my team at OBSS, has a report type that will meet your need. Our app is available for both Jira Cloud, and Data Center.
Timepiece mainly allows you to see how much time each issue spent on each status or each assignee.
Status Duration report (please see the screenshot above) which shows how much time each issue spent on each status. You can combine the time for multiple statuses to get metrics like Issue Age, Cycle Time, Lead Time, Resolution Time etc.
For all numeric report types, you can view the durations as a list and calculate averages and sums of those durations grouped by the issue fields you select.
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.
Tiimepiece 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.
We invite you to visit Timepiece (formerly Time in Status) to explore and enjoy a 30-day free trial of our full range of features.
If you wish, you can also schedule a live demo. We will provide a comprehensive overview of the application and address any inquiries you may have.
Hope it helps,
Gizem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Saad Haq ,
In Timepiece (formerly Time in Status) it is also possible to provide a time in status for the time the ticket was in a specific Jira project.
In the example below I moved these issues into 3 different projects and you can see how much time each issue spent on each status in each project.
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.