Community moderators have prevented the ability to post new answers.
I was thinking I needed to swap IssueService for IssueUpdater and IssueUpdateBean but it seems that IssueUpdate* just needs to be purged from AbstractCommentHandler.java. All I did was remove the references to the IssueUpdate* objects and replace them with GenericValue dummys as needed. Tested and so far functional in JIRA 4.3.4.
Here's a diff.
tof:tmp cpepe$ diff -r AbstractCommentHandler.java.stock-4.3.4 AbstractCommentHandler.java
1c1,9
< package com.atlassian.jira.service.util.handler;
---
> /*
> * Create or comment Handler that addes email recipients (to/cc list) as comment to newly
> * created issues. This is the stock JIRA mail handler that has been slightly modified.
> *
> * @author Christopher Pepe <pepeca@praecipio.com>
> * @date 11 Feb 2010
> */
>
> package com.praecipio.jira.plugins;
14,15d21
< import com.atlassian.jira.issue.util.IssueUpdateBean;
< import com.atlassian.jira.issue.util.IssueUpdater;
28a35,36
> import com.atlassian.jira.service.util.handler.AbstractMessageHandler;
>
33,34c41
< private final IssueUpdater issueUpdater;
<
---
>
41c48
< ComponentManager.getInstance().getIssueUpdater(),
---
> ComponentManager.getComponentInstanceOfType(GenericValue.class),
48c55
< protected AbstractCommentHandler(PermissionManager permissionManager, IssueUpdater issueUpdater, CommentManager commentManager, IssueFactory issueFactory, ApplicationProperties applicationProperties, JiraApplicationContext jiraApplicationContext)
---
> protected AbstractCommentHandler(PermissionManager permissionManager, GenericValue g, CommentManager commentManager, IssueFactory issueFactory, ApplicationProperties applicationProperties, JiraApplicationContext jiraApplicationContext)
52d58
< this.issueUpdater = issueUpdater;
154c160
<
---
>
158,176c164,165
< // Get the eventTypeId to dispatch
< Long eventTypeId = getEventTypeId(attachmentsChangeItems);
<
< // Need to update the Updated Date of an issue and dispatch an event
< IssueUpdateBean issueUpdateBean = new IssueUpdateBean(issue, issue, eventTypeId, reporter);
< // Set the comment on is issueUpdateBean such that the disptached event will have access to it.
< // The comment is also needed for generating notification e-mails
< issueUpdateBean.setComment(comment);
< if (attachmentsChangeItems != null && !attachmentsChangeItems.isEmpty())
< {
< // If there were attachments added, add their change items to the issueUpdateBean
< issueUpdateBean.setChangeItems(attachmentsChangeItems);
< }
<
< issueUpdateBean.setDispatchEvent(true);
< issueUpdateBean.setParams(EasyMap.build("eventsource", IssueEventSource.ACTION));
< // Do not let the issueUpdater generate change items. We have already generated all the needed ones.
< // So pass in 'false'.
< issueUpdater.doUpdate(issueUpdateBean, false);
---
> /* Praecipio edit: assuming this logic is handled in IssueService, seems to work without it.
> Can probably strip out all references to update() but leaving stub for now */
Still getting "2011-06-27 19:24:53,334 QuartzWorker-1 WARN ServiceRunner PRAE Pop Mail [com.atlassian.mail.MailUtils] Unable to extract text from MIME part with Content-Type 'multipart/alternative; boundary=00151750dadef9db5c04a6bc58a6" but seems stable and creates issues. Will report back in the morning.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
AbstractCommentHandler.java is the only place that IssueUpdater and IssueUpdateBean are used. Swapping out those classes for IssueService looks promising.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.