From my Jira plugin for Jira Server I want to resolve the information of which projects are in a concrete agile board. This information is already available inside the Jira Software GUI inside the board configuration on the filter page:

This information can also be resolved from the Jira Software REST API call:
agile/1.0/board/{boardId}/projectCalling this REST resource results in the information I need:

I am not aware of a Java API provided by Jira Software Server to resolve this information.
What is the best and preferred way of getting this information on the server side of my Jira plugin? Do I really need to consume the Jira Software REST API?