Is there a way to automate setting the priority of Jira based on the score or metric?

Foxly creates a custom field called “Priority Score“ by default. There is also an option to store metrics in custom fields. You are able to use these fields in Automation for Jira.

Here is an article with an automation example, and here you can find out how to enable storing metrics in the custom field.