You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I use this method to add an attachment to an issue:
def attachmentManager = ComponentAccessor.getAttachmentManager()
def bean = new CreateAttachmentParamsBean.Builder(tempFile,
def changeItemBean= attachmentManager.createAttachment(bean)
But customers can't see the attachment.
I wondered maybe I should add the attachment as a comment.
I didn't find a way to make attachment visible to customers. Neither was I able to attach it as a comment.
What do you think is the right way and how?
Try something like this,
def attachmentManager = ComponentAccessor.getAttachmentManager();
def issueManager = ComponentAccessor.getIssueManager();
CreateAttachmentParamsBean bean = new CreateAttachmentParamsBean.Builder(
tempFile, fileName, 'application/pdf', user, issue).build()
ChangeItemBean changeItemBean= attachmentManager.createAttachment(bean) issueManager.updateIssue(user,issue,new EventDispatchOption.Factory().get(EventType.ISSUE_UPDATED_ID),true)
There is no specific book, you can learn it from Jira's java api.
What it does is (line by line),
What we have done before this like is update issue object in issue to have an attachment associated with it.
But to save these changes that we have to done to issue object has to be transferred to database. So we call,
This method update issue object to database and raise and event so other jira services can know that issue has been updated.