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

Automation for Jira third-party action throws ClassCastException when componentInputs.getIssues() is called in concurrent mode

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 7.2.8
    • Java API
    • None

    Description

      Issue Summary

      Automation for Jira third-party action throws ClassCastException when componentInputs.getIssues() is called in concurrent mode

      Steps to Reproduce

      1. Build and run the attached "automation-thirdparty-sample-customized.zip" project with "atlas-debug" command. It is a trivially modified version of the official Automation sample app provided by Atlassian (https://bitbucket.org/atlassian/automation-addon-sample/src/master/automation-thirdparty-sample/) and modify it as per the "App modification details" section below.
      2. Create three issues with keys: SP-1, SP-2, SP-3.
      3. Create a new automation rule. Use trigger type "Custom issue created trigger" and add one "New Sample Comment" action (both provided by the sample app). The comment should be "Hello dear!" to avoid some hard-coded error checking.
      4. Trigger the automation rule by creating a new issue.
      5. Check the Audit Log for the rule's log output.
      6. Check the Jira log.

      This bug only shows up if all of these conditions are true:

      • the third-party API is used: BOTH the trigger and the action is a third-party component
      • at least one issue returned by the trigger
      • concurrent action execution is requested via .executeConcurrently (which is the recommended method as stated in the API docs)

      App modification details:

      • CustomIssueCreatedTrigger.execute() method is modified in a way to always pass exactly three issues to the rule engine:

      AdditionalInputsResultBuilder builder = new AdditionalInputsResultBuilder();
      builder.withIssues(Arrays.asList(
      ComponentAccessor.getIssueManager().getIssueByKeyIgnoreCase("SP-1"),
      ComponentAccessor.getIssueManager().getIssueByKeyIgnoreCase("SP-2"),
      ComponentAccessor.getIssueManager().getIssueByKeyIgnoreCase("SP-3")
      ));

      • Additionally the trigger is modified to use concurrent mode:
        builder.executeConcurrently();

        Expected Results

      The rule execution is successful, no errors in the Jira log and the audit log.

      Actual Results

      The rule execution fails, error in the Jira log and the audit log.

      Workaround

      None

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dmorrow@atlassian.com Dugald Morrow
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: