Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. import com.atlassian.jira.component.ComponentAccessor
  2. import com.atlassian.jira.user.ApplicationUser
  3. import com.atlassian.jira.issue.fields.config.FieldConfig
  4. import com.atlassian.jira.issue.fields.CustomField
  5. import com.atlassian.jira.issue.customfields.option.LazyLoadedOption
  6. import com.atlassian.jira.issue.customfields.option.OptionsImpl
  7. import java.text.SimpleDateFormat
  8. import java.util.Date
  9. import org.joda.time.DateTime
  10. import org.apache.log4j.Level
  11. import org.apache.log4j.Logger
  12. log = Logger.getLogger("com.tvpro.CreateIssue")
  13. log.setLevel(Level.DEBUG)
  14.  
  15. def locale = ComponentAccessor.applicationProperties.defaultLocale
  16. def simpleDateFormat = new SimpleDateFormat("dd/MMM/yy HH:mm", locale)
  17. def newSimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX")
  18.  
  19. def linkMgr = ComponentAccessor.getIssueLinkManager()
  20. def issue = ComponentAccessor.getIssueManager().getIssueByCurrentKey("PP1-18842")
  21. def customField = ComponentAccessor.customFieldManager.getCustomFieldObject("customfield_11601")
  22. def dataVihodaEfira = ComponentAccessor.customFieldManager.getCustomFieldObject("customfield_11504") //Дата выхода рубрики в эфир
  23. def dataVihodaEfiraValueOld = issue.getCustomFieldValue(dataVihodaEfira)
  24. def dataVihodaEfiraValueNew = simpleDateFormat.format(dataVihodaEfira.getValue(issue))
  25. def Deadline = new DateTime(dataVihodaEfiraValueOld).minusDays(1).toString() // Заполняем поле Deadline
  26. def date = newSimpleDateFormat.format(Deadline)
  27. log.debug("Дата выхода рубрики в эфир в задаче Промо: " + dataVihodaEfiraValueOld)
  28. log.debug("Дата выхода рубрики в эфир для задачи Оперативная графика: " + dataVihodaEfiraValueNew)
  29. log.debug(Deadline)
  30. log.debug(date)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement