I have a "sync attachement listener" - listening on "Issue updated" and I works fine from the JIRA Interface.
The code is partly:
-------
List changeItems = event.getChangeLog()?.getRelated("ChildChangeItem")
changeItems.each {GenericValue gv ->
if (gv["field"] == "Attachment" && gv["newvalue"]) {
attachmentIds.add(gv["newvalue"])
Integer AttachmentId=Long.parseLong(gv["newvalue"])
Attachment AttachmentObject=attachmentManager.getAttachment(AttachmentId)
// If the comment is by AgentRobot, do not send it back (loop)
if (AttachmentObject.getAuthorObject() != userManager.getUserByKey("AgentRobot"))
{ attachmentManager.copyAttachment(AttachmentObject,userManager.getUserByKey("AgentRobot"),targetIssue.key) log.info "Script=" + scriptName + " IssueKey=" + issueKey + " ScriptRunIdent=" + scriptRunIdent + " Message='Attachment " + AttachmentObject.getFilename() + " copied to " + targetIssue.key + "'" }
}
}
On the Web Portal - Issue Updated is never fired for attachments, only "Issue Commented" - and the changeItems does not represent the attachment.
How can I get the attachment handle/info?
Its 7.13.1 and JSD 3.16.0