Use this script to search an email message body and find an existing epic/initiative issue key. The script then creates a new issue within that epic/initiative as the new Stories Epic Link field value.
As a project manager, I want to automate the process of creating new stories under existing epics when a user sends an email to Jira with the epic key in the message body — saving manual effort and time.
Good to Know
If the subject contains an existing issue key this script exists and does not create a new issue to avoid creating duplicates
We use the findIssueObjectInString method provided by Jira's ServiceUtils class to search for issue key strings like TEST-1
This Script will only create a new issue if the message body contains an issue key pointing to an existing epic or initiative