Is there any way I can get the screens'I IDs or names a custom field is in using JIRA Server API?

I know that in cloud this task is very easy to do, but there are any way I can get this info in Jira Server API? There’s only a screensCount property in the custom fields endpoint…

Welcome to the Atlassian Developer Community, @EduardoNunes!

In my experience, I have not found a single Jira Server REST API call to return this value. However, there is an approach to do this but would require a number of calls by starting the journey from screens.

  1. Get all screens (GET /rest/api/2/screens)
  2. Iterate over the screen IDs to get all tabs (GET /rest/api/2/screens/{screenId}/tabs)
  3. Use the screenId and tabId pairs to get all the fields for that tab (GET /rest/api/2/screens/{screenId}/tabs/{tabId}/fields) which should return something like
    "id": "summary",
    "name": "Summary",
    "type": "System field"
    "id": "issuetype",
    "name": "Issue Type",
    "type": "System field"
    "id": "customfield_10000",
    "name": "Test Label Manager",
    "type": "Label Manager"
    "id": "customfield_10100",
    "name": "Test Select List",
    "type": "Select List (single choice)"

From the data that you have - screenId, tabId, and a list of fields from a specific tab - you can then map a custom field to specific screens.

Hope this helps.