Fetch Jira projects first and only send the data if the project part of the issue key exists
See #352411 (comment 1271002431).
Data sent to Jira must contain a Jira issue key, so Jira can match the data to an issue and show it on the right place. To fetch the issue key we scan MR title, MR description, commit message, branch name for strings matching the Jira issue key pattern.
The pattern is {project_key}-{issue_id}
. We don't double-check with Jira if an issue key exists before sending the data. Terms like FY-2023
match the pattern, but might not be intended to point to an issue.
To fix this, we can fetch a list of projects from Jira and validate the project key part of the issue keys
Edited by Andy Schoenen