Context:
I am trying to recreate the "Epic Link" or "Component/s" or "Fix Version" like experience on a scripted field.
Docs: https://scriptrunner.adaptavist.com/5.5.0/jira/script-fields/issue-picker.html#_usage solves the first part of the experience below but not the second.
Experience:
As a user, I want to be able to start typing in something like "Foobar" and a list of issues that have "Foobar" in the text to start showing up in a drop down list (similar to the Epic Link experience and include the "None found" option), so that I can quickly find the issue I am looking for in the project.
As a user, I want to be able to restrict the search in the JQL by the current project (similar to the Component/s Fix Version functionality; most of the JQL search query examples have been "project = XXX"), so that I can only see the relevant issues to the specific project.
As a user, I want to be able to see the key of the issue I selected in the field, so I know that I selected the correct issue. This would also allow it to show up as a free text searcher and in issue navigator.
Things I was thinking of:
project in projectMatch(<issueKey>) but I don't know how to extract that / if that would work.
Semi okay experience:
project in recentProjects()
Some other documentation I have been researching:
https://scriptrunner.adaptavist.com/5.4.47/jira/recipes/misc/running-a-jql-query.html
https://scriptrunner.adaptavist.com/5.0.4/jira/scripted-fields.html#_jql_searches_in_script_fields
Potentially doing this and the top doc of issue picker may work:
Does anyone have any suggestions?
Edit: Added a mixed solution of using the scripted field and behavior. Is that the best solution?