SHARE
TWEET

Untitled

a guest Jun 25th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top