How can I get fields present on screen via REST API

How can I get fields present on screen via REST API?

There is an REST API https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-screens/#api-rest-api-2-screens-get for getting screen fields bu it is not returning fileds available on screen.

As far as I remember, you need to call Get all screen tabs and then Get all screen tab fields. In case when you have multiple tabs, you need to iterate over them.

Let us know if it helps you.

1 Like

Please give me a minute as I need to embrace, the pace of you response time.

2 Likes

If I want to get editable fields for project then:

  1. For ProjectId I get a collection of IssueTypeId https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-type-schemes/#api-rest-api-3-issuetypescheme-project-get
  2. For each IssueTypeId I get a collection of ScreenScheme https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-type-screen-schemes/#api-rest-api-3-issuetypescreenscheme-get
  3. For each ScreenScheme I get a collection of Screen. Here I can decide which of them are editable. Defualt screen If only once screen or edit Screen if multiple of them? https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-schemes/#api-rest-api-3-screenscheme-get
  4. For each Screen I get a collection of ScreenTab https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-screen-tabs/#api-rest-api-2-screens-screenid-tabs-get
  5. For each ScreenTab I get a collection of Fields https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-screen-tabs/#api-rest-api-2-screens-screenid-tabs-get

I’m not sure if we understand in the same way the response of get screen schemes endpoint and the meaning of editable.

From what I know, these values edit, view, and create respond to a question - which screen should be displayed on the issue edit screen, issue view and issue create screen. If these values are not listed, the default screen is used.

There is a high chance that when a field is not present on the edit screen you can’t modify it via edit issue, but I’m happy to confirm that. :slight_smile:

1 Like

Confirmed, you can’t modify the field if it’s not on the screen neither via UI nor via REST API.

To summarise,
if screen scheme API returns:

 {
      "id": 10032,
      "name": "Office screen scheme",
      "description": "Manage office data",
      "screens": {
        "default": 10020
      }
   }

Only fields that are on the screen with id 10020 can be edited.

When the response is:

{
      "id": 10010,
      "name": "Employee screen scheme",
      "description": "Manage employee data",
      "screens": {
        "default": 10017,
        "edit": 10019,
        "create": 10019,
        "view": 10020
      }
    }

the default doesn’t matter, because for every “type” view we have different screens declared, so you can edit fields from screen 10019.

When the response is:

{
      "id": 10010,
      "name": "Employee screen scheme",
      "description": "Manage employee data",
      "screens": {
        "default": 10017,
        "create": 10019,
        "view": 10020
      }
    }

No edit in the response - then fields that are on the default screen can be modified.

1 Like

Great! I am very thankful :slight_smile:

How about next-project? How can we get editable/viable fields on nextgen projects?

Team-managed project configuration is out of the scope of my knowledge :stuck_out_tongue:
I’ve pinged a team, which can have broader knowledge.
I hope they will help.

Beata,
Did the team managed to help?

Here is what I get from the team. I hope it helps.

There’s no particular API which people can use to fetch fields in a screen for Next-gen. Because Next-gen fields are all “inline-editable” so customers can use the editMetadata REST API to fetch all “editable” fields in Next-gen as a workaround.

1 Like

@BeataSzturemska API Get edit issue metadata is for a particular issue only. It’s not possible to get all editable fields for whole project (for issue type in a project).

There’s a call Get create issue metadata which returns fields for the create issue screens for all issue types in the requested project.

Do not know differences between “Get create issue metadata” and “Get edit issue metadata”, i.e. when some fields may be missing in one of them only. Can you clarify that?

I miss some system fields, e.g. Status, in results of both of these calls.