Hi everyone,
i want to calculate age of issue and have script like that:
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueManager
def issueManager = ComponentAccessor.getIssueManager()
if (issue.status.name == "RESOLVED" && "FAILED" && "CLOSED"){
return (issue.getResolutionDate() - issue.created)*24*60*60
} else {
return (new Date()- issue.created)*24*60*60
}
it calculate great age of opened issue, but i can't calculate age of closed issue, i mean how long was this issue active.
btw. i have 3 fields with Date: Created, Updatet and Resolved. Updated - Created works, Resolved - created not.
I try to define issue status in order for the script to understand in which case to calculate and than date of resolved issue subtract from issue created.
How can i define my status and issue.resolved than subtract it?