Link a JIRA ticket to automated tests scripts

I’m looking for the best way to solve the following problem:

As a developer writing a ticket, I want to be able to connect my JIRA ticket with an automated test that is ran through my CI process. This can be solved in a very generic way where when creating a ticket, I have the ability to link user defined key values. Like “Remove a user” would be the key that I can browse/search and select to link from within the ticket, but its value can be retrieved that points to something like “remove_a_user.js” so that another script that is triggered by ci can query JIRA and get all tickets in a particular swim lane, and get the values of those attached key-value pairs to execute each test returned.

@TroyPayne - for storing arbitrary key values, you can use Entity Properties, and in this case, your entity would be an issue. See Entity properties

For more of a planned list of values, you could use components (a generic container for issues). They can be created dynamically or through the UI. https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-group-Project-components.

In your CI, you can execute a JQL search for issues by component.

As far as event triggering, you can register/declare webhooks. See https://developer.atlassian.com/cloud/jira/software/webhooks/