Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.16] [ResponseOps][Cases] Introduce number custom field type (#195245) #198259

Closed

Commits on Oct 30, 2024

  1. [ResponseOps][Cases] Introduce number custom field type (elastic#195245)

    Issue: elastic#187208
    
    In this PR I've added new number custom field. It includes both: FE and
    BE.
    Only safe integers (the safe integers consist of all integers from
    -(2^53 - 1) to 2^53 - 1) are allowed as values.
    
    Testing:
    For testing Postman/Insomnia can be used.
    Go to Case - Settings. New configure will be created.
    After that you can use this endpoint:
    `PATCH
    http://localhost:5601/hcr/api/cases/configure/7377ed43-af0c-46f1-bbe5-fd0b147d591d`
    
    <details><summary>Body looks something like this:</summary>
    
    {
        "closure_type": "close-by-user",
        "customFields": [
            {
                "type": "number",
                "key": "54d2abf2-be0e-4fec-ac33-cbce94cf1a10",
                "label": "num",
                "required": false,
                "defaultValue": 123
            },
            {
                "type": "number",
                "key": "6f165838-a8d2-49f7-bbf6-ab3ad96d0d46",
                "label": "num2",
                "required": false,
                "defaultValue": -10
            }
        ],
        "templates": [],
        "connector": {
            "id": "none",
            "type": ".none",
            "fields": null,
            "name": "none"
        },
        "version": "WzIyLDFd"
    }
    
    </details>
    
    ![Screenshot 2024-10-07 at 16 23
    15](https://github.com/user-attachments/assets/2d769049-e339-47bb-a17d-189569b8785d)
    
    Try different numbers: positive and negative. Try to add not number
    types as a default value with `"type": "number"`
    
    ### Checklist
    
    - [x] [Unit or functional
    tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
    were updated or added to match the most common scenarios
    
    ---------
    
    Co-authored-by: kibanamachine <[email protected]>
    (cherry picked from commit 7cad9c3)
    guskovaue committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    36fa859 View commit details
    Browse the repository at this point in the history