We are trying to set a custom field(date/time) when an issue is linked with a certain link type direction but only to a certain project. Is there a way to get the created date/time from the history when the issue is linked?
Here is what I have so far but it returns null. if i remove the contains i end up getting all linked history fro the issue.
{code}
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
Issue issue = issue
IssueManager issueManager = ComponentAccessor.getIssueManager()
def changeHistoryManager = ComponentAccessor.getChangeHistoryManager()
def changeHolder = new DefaultIssueChangeHolder()
log.debug "testing"
def time = changeHistoryManager.getChangeItemsForField(issue, "Link").collect { it.to.contains("PC-") }
log.debug(time)
{code}