Automation for Jira third-party action throws ClassCastException when componentInputs.getIssues() is called in concurrent mode
- 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.
- Create three issues with keys: SP-1, SP-2, SP-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.
- Trigger the automation rule by creating a new issue.
- Check the Audit Log for the rule's log output.
- 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();
- Additionally the trigger is modified to use concurrent mode:
The rule execution is successful, no errors in the Jira log and the audit log.
The rule execution fails, error in the Jira log and the audit log.