Dear all,
I'm trying to create a groovy script to create a new issue out of the current issue's linked issue.
I'm unable to set reporter into the new issue, thus new issue is failing to be created programmatically from the current issue.
Error: Validation failed for new issue: Errors: {reporter=The reporter specified is not a user.} Error Messages: []
Where as I'm using a reporter name with valid permissions to create the issue.
Could someone explain how to retrieve the reporter?
final String TEMP_REPORTER_USERNAME = "automation"
// Debug currentIssue.reporter
def currentReporter = currentIssue.reporter
log.info("Current issue reporter: name=${currentReporter?.name}, key=${currentReporter?.key}, active=${currentReporter ? userManager.getUserByKey(currentReporter.key)?.active : 'null'}")
if (!currentReporter) {
log.error("Current issue reporter is null")
} else if (!userManager.getUserByKey(currentReporter.key)?.active) {
log.error("Current issue reporter is inactive: name=${currentReporter.name}, key=${currentReporter.key}")
}