Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-31325

IssueService in Listener update mismatch

    XMLWordPrintable

Details

    • Bug
    • Resolution: Answered
    • Low
    • None
    • 5.1, 5.2
    • None

    Description

      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."); }

      }
      }
      }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              9fbb46561d0e Pavla Kurkova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: