Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import com.atlassian.jira.component.ComponentAccessor
  2.  
  3. import com.atlassian.jira.issue.MutableIssue
  4. import com.atlassian.jira.event.issue.AbstractIssueEventListener
  5. import com.atlassian.jira.bc.issue.IssueService
  6.  
  7.  
  8. def issue = event.issue as MutableIssue
  9.  
  10.  
  11. def createdDate = issue.getCreated()
  12. def resolvedDate = issue.getResolutionDate()
  13. if(issue.issueType.name == 'LAB')
  14. {
  15. if (createdDate && resolvedDate)
  16. {
  17. Integer duration = new Double(resolvedDate.getTime() - createdDate.getTime())/(1000*60*60*24).toInteger()
  18. Long timeSpentVal = (duration * 60 * 60 * 8).toLong()
  19. issue.setTimeSpent(timeSpentVal)
  20.  
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement