Use this script to capture the CC users from an email sent to Jira with the ScriptRunner Mail Handler, then create a new issue with the assignee field set to the first valid CC user.
To be considered a valid user, the CC email address must be linked to a Jira user.
If the first CC user is not valid, the script searches all CC email addresses until it finds a valid user. If no user is found, the issue is created without an assignee.
As a project manager, I want to automate the process of creating tickets when an email request is received. As part of this process, I want to ensure each ticket is assigned to the relevant team member. This script allows me to automatically assign a user based on the email CC list.