Custom fields

Introduction

Custom fields allow you to add flexible data to Next Project. As of now they are only implemented for projects. Whether you’re tracking additional project-specific information or need to store integration-specific data, custom fields provide a powerful way to tailor your application to your needs.

Endpoints

Let’s dive into the available endpoints for managing custom fields:

  1. GET /project/{project_id}/customfields

    • Description: Retrieve custom field data for a specific project.
    • Usage:
      • Provide the {project_id} parameter to fetch custom field data associated with that project.
      • The response will be empty if no custom field data exists for the specified project.
    • Example:
      GET /project/123/customfields
      
  2. POST /project/{project_id}/customfields/

    • Description: Create custom field data for a specific project.
    • Usage:
      • Use the request body to specify the custom field details:
        {
          "name": "thenameofthecustomfield",
          "value": "valueofthecustomfield"
        }
        
      • This endpoint should be used if there is no custom field data for the specified project + custom field combination
    • Example:
      POST /project/123/customfields/
      Body: {"name": "priority", "value": "high"}
      
  3. PUT /project/{project_id}/customfields/

    • Description: Edit existing custom field data for a specific project.
    • Usage:
      • Use the request body to update custom field details like the POST request.
      • Specify the custom field name and the new value.
    • Example:
      PUT /project/123/customfields/
      Body: {"name": "priority", "value": "medium"}
      
  4. GET /type/customfield/

    • Description: Retrieve all existing custom fields.
    • Usage:
      • This endpoint provides a list of available custom fields.
      • Note that creating custom fields via the API is not supported; it must be done in Next Project.
    • Example Response:
      "items": [
        {
          "id": 5,
          "fieldset": "Other",
          "name": "sector",
          "tablename": "Project",
          "type": "String"
        }
      ]
      
  5. GET /type/customfield/{customfield_id}/option

    • Description: List the options for a custom field with type “Select.”
    • Usage:
      • Only relevant for custom fields with type “Select.”
      • Retrieve the available options for a specific custom field.
      • Options cannot be created via the API; this must be done in Next Project.
    • Example Response:
      "items": [
        {
          "name": "public sector"
        }
      ]