Hello,
How to display a difference between issue created date and issue resolved date using JQL. Need to display the data per issue in Confluence using Jira macro
Thank you!
You cannot as JQL return a list of issue but what you can do us to use a JIRA Issue Macro, input your JQL then display the created date and resolved date.
If you need the number of days you will have to use a calculated field in JIRA from an app. You should be able to do it with Scriptrunner.
Regards
Hi Florian, thanks again. I’ve already done this but my team is looking for a column that shows the time (days) spent on a task. I tried to find it among “Columns to display”
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You may try to create an automation for JIRA that compute the number of days between both date and store this value in a field or even log this time against that issue and display the Time Spent.
Automation for JIRA is free if you are in Data Center.
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
Doc is for Cloud but those function should work on Server as well.
Regards
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.
I agree with @Florian Bonniec
You can achieve the same with ScriptRunner for Jira as well.
I have a similar script to calculate the age of a ticket which might help you get started.
import com.atlassian.core.util.DateUtils
def createTime = issue?.getCreated()?.getTime() def currentTime = (new Date()).getTime() def resolvedTime = issue?.getResolutionDate()?.getTime()
/* https://docs.atlassian.com/jira/server/com/atlassian/jira/issue/status/category/StatusCategory.html COMPLETE == 'done' IN_PROGRESS == 'indeterminate' TO_DO == 'new' UNDEFINED == 'undefined' */
def issueCategory = issue?.getStatus().getStatusCategory().getKey()
// if ticket category is undefined/no category if (issueCategory == 'undefined') { return 0 }
// if ticket category is TO_DO/new or IN_PROGRESS/indeterminate // OR if resolvedTime is null, calculate age using ticket created time def ageInDays = issueCategory in ['new', 'indeterminate'] || resolvedTime == null ? (currentTime - createTime) / 86400000 // milliseconds in a day : (resolvedTime - createTime) / 86400000 // milliseconds in a day
if (ageInDays > 90) { return 3 } else if (ageInDays > 60 && ageInDays <= 90) { return 2 } else if (ageInDays > 30 && ageInDays <= 60) { return 1 } else { return 0 } |
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.