public def lastTransitionTo()

in src/main/groovy/com/epam/esp/jira/issue/AbstractBaseIssueProcessor.groovy [119:143]


    public def lastTransitionTo(SearchHit issue, String... statuses) {
        def resultDate = null
        def changeLog = issue.sourceAsMap.changelog
        if (changeLog != null) {
            def histories = changeLog.histories
            if (histories == null) return null
            else {

                DateTimeFormatter dtf = DateTimeFormat.forPattern(JiraHelper.JIRA_DATE_FORMAT)
                histories.each { history ->
                    if (isTransitionTo(history.items, statuses)) {
                        def date = dtf.parseDateTime((String) history.created)
                        if (resultDate == null) {
                            resultDate = date
                        } else {
                            if (resultDate.getMillis() < date.getMillis()) {
                                resultDate = date
                            }
                        }
                    }
                }
            }
        }
        return resultDate
    }