Hello,
i have a problem with copying the fixversion from task in project A to task in projekt B. The copying works well and I have also some entries in the history-tab, but i can't filter for these version in the projekt releases view.
I think, the problem is that each project has unique versions, even if i name them the same and my script copies the version from project A to my task in project B. The name is the same but the ID is different.
How can I change my script to make this work? I think, that i have to compare the versions i get from project A to the versionlist of project B but I don't know how.
This is an extract of my script:
// Check if fixVersion is updated
if (LastChangeDate != null){
LastChangeDateFormat = LastChangeDate.format("yyyy-MM-dd hh:mm:ss")
}
if (LastChangeDateFormat >= currentDate) {
log.debug("${issueKey} fixVersions changed ${LastChangeDate}")
def fixVersions = issue.getFixVersions()
log.debug("FixVersion lautet ${fixVersions}")
// Updating FixVersions in Customer Issue
if (issueLinkManager.getOutwardLinks(issue.getId()).findAll {it.issueLinkType.name == 'Customer Project'}) {
for (IssueLink link in issueLinkManager.getOutwardLinks(issue.getId()).findAll {it.issueLinkType.name == 'Customer Project'}) {
def destIssueCust = link.getDestinationObject()
//versionManager.updateIssueFixVersions(destIssueCust, fixVersions);
//ComponentAccessor.getIssueManager().updateIssue(CurrentUser, missue, com.atlassian.jira.event.type.EventDispatchOption.DO_NOT_DISPATCH, false);
destIssueCust.setFixVersions(fixVersions)
ComponentAccessor.getIssueManager().updateIssue(CurrentUser, destIssueCust, com.atlassian.jira.event.type.EventDispatchOption.DO_NOT_DISPATCH, false);
log.debug("${issueKey} fixVersions changed in customer issue ${destIssueCust}")
}
}