Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.atlassian.jira.component.ComponentAccessor
- import com.atlassian.jira.issue.MutableIssue
- import com.atlassian.jira.event.issue.AbstractIssueEventListener
- import com.atlassian.jira.bc.issue.IssueService
- def issue = event.issue as MutableIssue
- def createdDate = issue.getCreated()
- def resolvedDate = issue.getResolutionDate()
- if(issue.issueType.name == 'LAB')
- {
- if (createdDate && resolvedDate)
- {
- Integer duration = new Double(resolvedDate.getTime() - createdDate.getTime())/(1000*60*60*24).toInteger()
- Long timeSpentVal = (duration * 60 * 60 * 8).toLong()
- issue.setTimeSpent(timeSpentVal)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement