Hi there,
I want to create an issue where the description includes an image tag like !image.png!. The image should be attached to that issue within the create operation. This is to ensure that the image is already there when the create postfunctions will run. E.g. the create notification should render and contain this image.
I tried this two calls.
final Issue issue = this.getIssueManager().createIssueObject(reporter, fields);
// postfunctions will run here
final ChangeItemBean cib = attachmentManager.createAttachment(file, filename, contentType, reporter, issue);
When doing so the issue is created without the attachment. The notification mail say:
"Unable to render embedded object: File (image.png) not found."
That is because the second call to the attachmentManager updates the issue with the image after it is already created.
In inverse order an exception is thrown claiming that the issue where to attach the image does not exists.
final ChangeItemBean cib = attachmentManager.createAttachment(file, filename, contentType, reporter, issue);
// Exception is thrown.
final Issue issue = this.getIssueManager().createIssueObject(reporter, fields);
Can anyone point me to the right direction?
Cheers,
Jan
You have to go with IssueService issueService.validateCreate(..), TemporaryAttachmentsMonitor, IssueService.IssueResult. QuickCreateIssue.java give some hints.
You could add "Attachments" to your create screen and add a validator on create that requires the attachments field..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have to use the Java API from Jira to solve my problem. However I tried to create an issue with an attached image over the GUI create screen. This works well and the image is attached within the create operation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.