Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.atlassian.jira.component.ComponentAccessor
- import com.atlassian.jira.user.ApplicationUser
- import com.atlassian.jira.issue.fields.config.FieldConfig
- import com.atlassian.jira.issue.fields.CustomField
- import com.atlassian.jira.issue.customfields.option.LazyLoadedOption
- import com.atlassian.jira.issue.customfields.option.OptionsImpl
- import java.text.SimpleDateFormat
- import java.util.Date
- import org.joda.time.DateTime
- import org.apache.log4j.Level
- import org.apache.log4j.Logger
- log = Logger.getLogger("com.tvpro.CreateIssue")
- log.setLevel(Level.DEBUG)
- def locale = ComponentAccessor.applicationProperties.defaultLocale
- def simpleDateFormat = new SimpleDateFormat("dd/MMM/yy HH:mm", locale)
- def newSimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX")
- def linkMgr = ComponentAccessor.getIssueLinkManager()
- def issue = ComponentAccessor.getIssueManager().getIssueByCurrentKey("PP1-18842")
- def customField = ComponentAccessor.customFieldManager.getCustomFieldObject("customfield_11601")
- def dataVihodaEfira = ComponentAccessor.customFieldManager.getCustomFieldObject("customfield_11504") //Дата выхода рубрики в эфир
- def dataVihodaEfiraValueOld = issue.getCustomFieldValue(dataVihodaEfira)
- def dataVihodaEfiraValueNew = simpleDateFormat.format(dataVihodaEfira.getValue(issue))
- def Deadline = new DateTime(dataVihodaEfiraValueOld).minusDays(1).toString() // Заполняем поле Deadline
- def date = newSimpleDateFormat.format(Deadline)
- log.debug("Дата выхода рубрики в эфир в задаче Промо: " + dataVihodaEfiraValueOld)
- log.debug("Дата выхода рубрики в эфир для задачи Оперативная графика: " + dataVihodaEfiraValueNew)
- log.debug(Deadline)
- log.debug(date)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement