Hi,
I'm using the ScriptRunner script for getting the Time in a particular status. I am able to get the times for all other statuses except the first status after the issue is opened, in this case Open. Here is the script I'm using:
============================================
I'm trying to adjust the script so that I can get the time in the first status which at this point keeps returning a zero.
Any pointers on how to adjust it to get the duration of the first status the issue transitions into?
Thanks
Note: I'm on JIRA Server version v8.20.11
You've run into something that I think of as a design flaw in the original database.
An issue object is a simple row in a table in the database, holding the current data for it. That's an intuitive and natural way to hold a representation of an object, the way most humans will think about it.
But it's not the right way to do it for an object that might change. Instead of "current object" and then a "change history" in a different place, a better design would be to have one row per change and an indicator of "current". Create issue creates the first row, then edits create new ones. It's not an efficient use of disk space, but it makes reporting much easier to code for.
Anyway, in the current structure, creating an issue creates the issue object. There's no history to it, and the history only starts when you first update the issue.
So, you need to catch that. The first status entry in the change log will contain a "from" status. You must find that entry, read its date/time, and subtract the issue.created date/time from it (instead of another history log)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.