IssueService in Listener update mismatch

XMLWordPrintable

    • Type: Bug
    • Resolution: Answered
    • Priority: Low
    • None
    • Affects Version/s: 5.1, 5.2
    • Component/s: None
    • 5.01

      Since JIRA 5.1 I am not able to use the IssueService (or IssueManager - the same problem) within a listener, after transition is finished my update will be reindexed by old version.
      It affects both update() and assign() function, at least for events Issue Created and Issue Updated (other events not tested).

      My code was running fine in JIRA 5.0, now I always get "Issue Updated" and correct entry in history, but the data is wrong:

      @EventListener
      public void onIssueEvent(IssueEvent issueEvent) {
      if (issueEvent.getEventTypeId().equals(EventType.ISSUE_CREATED_ID) ){
      IssueInputParameters issueInputParameters = issueService.newIssueInputParameters();
      issueInputParameters.setComment("Testing comment");
      issueInputParameters.setDescription("Testing desc");

      Issue issue = issueEvent.getIssue();
      UpdateValidationResult result = issueService.validateUpdate(issue.getReporter(), issue.getId(), issueInputParameters);

      if (result.isValid()) {
      IssueResult ir = issueService.update(result.getIssue().getReporter(), result);
      if (ir.isValid())

      { log.info("Issue updated."); }

      }
      }
      }

              Assignee:
              Unassigned
              Reporter:
              Pavla Kurkova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: