How to add custom field to create/edit issue screen of a project?

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 of above steps for better understanding

How can i duplicate this behaviour using API?

It would be great help. Thanks in advance

Hi @shubham123,

You can add a custom field to a screen tab of a company-managed project by using the Add screen tab field REST API. A sample request would be

POST {{baseUrl}}/rest/api/3/screens/:screenId/tabs/:tabId/fields

with the request body

{
  "fieldId": "customfield_10107"
}

A successful request will return an HTTP 200 OK with a response like

{
    "id": "customfield_10107",
    "name": "My Paragraph CF"
}

After reaching out to the Jira folks, unfortunately, this only supports company-managed projects and not team-managed ones (like in your sample images).

Hope this helps.
Ian