Adding custom field to a project screen

I am trying to add a custom field to a project screen

I am trying to follow below steps:

  1. Get all screens
  2. Get screen tab fields
  3. Create a custom field
  4. Add custom field to screen tab

For this, i first made a request to get all screens using /rest/api/3/screens endpoint
Got below response from this

{
    "self": "https://some.atlassian.net/rest/api/3/screens?maxResults=100&startAt=0",
    "maxResults": 100,
    "startAt": 0,
    "total": 8,
    "isLast": true,
    "values": [
        {
            "id": 1,
            "name": "Default Screen",
            "description": "Allows to update all system fields."
        },
        {
            "id": 2,
            "name": "Workflow Screen",
            "description": "This screen is used in the workflow and enables you to assign issues"
        },
        {
            "id": 3,
            "name": "Resolve Issue Screen",
            "description": "Allows to set resolution, change fix versions and assign an issue."
        },
        {
            "id": 10000,
            "name": "JOP: Simple Default Issue Screen",
            "description": "",
            "scope": {
                "type": "PROJECT",
                "project": {
                    "id": "10000"
                }
            }
        },
        {
            "id": 10001,
            "name": "JOP-10001",
            "description": "",
            "scope": {
                "type": "PROJECT",
                "project": {
                    "id": "10000"
                }
            }
        },
        {
            "id": 10002,
            "name": "JOP-10002",
            "description": "",
            "scope": {
                "type": "PROJECT",
                "project": {
                    "id": "10000"
                }
            }
        },
        {
            "id": 10003,
            "name": "JOP-10003",
            "description": "",
            "scope": {
                "type": "PROJECT",
                "project": {
                    "id": "10000"
                }
            }
        },
        {
            "id": 10004,
            "name": "JOP-10005",
            "description": "",
            "scope": {
                "type": "PROJECT",
                "project": {
                    "id": "10000"
                }
            }
        }
    ]
}

and when trying to get screen tabs for project screen with id 10001, i am making a GET request to /rest/api/3/screens/10001/tabs and getting response mentioned below

{
    "errorMessages": [
        "Screen with id 10001 does not exist"
    ],
    "errors": {},
    "reasons": []
}

Can you tell me what i am doing wrong here or if there is any other way to do so?

Hello @shubham123

When you use the GUI, are you able to access that screen and manually add new tabs or change the layout?

Also, you’ve tagged your question as being about Jira SERVER, but you’re using Jira CLOUD endpoints.

No, if i go on screens page, it only shows me the first 3 screens i.e. Default Screen with id 1, Workflow screen with id 2, Resolve issue screen with id 3. But adding a custom field to these screens is not affecting Create/Edit issue screen.

Also i just need to add custom field to create/edit issue screen, if there is any other way than this, then please do share

You seem to be talking cross topics. Originally you asked about getting the tabs on a screen with the ID 10001 with the name “JOP-10001”, now you are talking about adding a custom field to a different ‘Create/Edit issue screen’ of totally different screens.

If you couldn’t find that screen with the ID 10001 via the GUI, it probably is a custom screen that belongs to a third party application, or has a special use, or you don’t rights to, so that’s why can’t alter it, so that’s a good indication that you probably shouldn’t be trying to use that one.

At the moment it sounds like you’re just guessing at which screens are which are and what their purpose is. I suggest you follow the following steps.

  1. USING THE GUI, locate the specific screen you want and note its name
  2. Then find if it is a screen for Creating and Editing OR just Creating or just Editing issues
  3. Then find if that screen does or does not have tabs
  4. Then put the field on the correct tab of the correct screen
  5. Then use the REST API to test to see if that field is on the tab on the screen

If all the above work doing it all via the GUI first to ensure you have the rights to do that to that screen, then replicate the whole process via the REST API.

Have fun.

Its my first time using it thats why i dont know much, but consider this

I am able to do the following using GUI

  1. I go into Projects page, select my JOP project
  2. Go to project settings
  3. Select issue types (Bug, Epic, Task, Sub task) for example bug here
  4. Drag and drop field test_obj_id_1 (which is a custom field) in context fields for Bug
  5. Then edit bug settings and check test_obj_id_1 to show up on issue screen

I have attached link for pdf file of screenshots for better understanding

How can i duplicate this behaviour using API?

It would be great help. Thanks in advance