500 Internal Server error when using some attributes in Change REST API

I am using REST API for freshservice “Change” entity. It will run perfectly fine with almost all attributes.
But when I was using 4 attributes:

  1. “change_reason”
  2. “backout_plan”
  3. “change_impact”
  4. “change_plan”

I receive 500 error response. Below I attached error


Got this same error for all 4 attributes. Can somebody helps me with this why I got this error.

Hi Abhishek Goyal,
In the table of supported fields for the Change object from the documentation I don’t see the fields you mention.

Are they custom fields?

For custom you have to use the structure:

{
    "description": "<div>Hi Team, <br/><br/> One of our email servers, Exchange Server (ES3) has been acting up. We tried rebooting it, but that didn’t help. We need to get it replaced ASAP. <br/><br/>Regards<br/> Rachel<br/> </div>",
    "subject": "Getting ES3 back up to speed",
    "email": "tom@outerspace.com",
    "priority": 1,
    "status": 1,
    "group_id": 1,
    "risk": 1,
    "change_type": 1,
    "impact": 1,
    "planned_start_date": "2019-03-20T16:18:46Z",
    "planned_end_date": "2019-03-23T16:18:46Z",
    "custom_fields":{
        "change_reason": "hello!"
    },
    "department_id": 1,
    "agent_id": 1,
    "maintenance_window": {
        "id": 1
    },
    "workspace_id": 3
}
1 Like

@Mattia_Piparo When we create change from freshservice UI we get these four option:


So, I want these fields in my REST API

Thanks for the clarification! Then you have to use the object “planning_fields” like this.

{
    "description": "Test",
    "subject": "My Test",
    "email": "tom@outerspace.com",
    "priority": 1,
    "status": 1,
    "risk": 1,
    "change_type": 1,
    "impact": 1,
    "planned_start_date": "2023-09-20T16:18:46Z",
    "planned_end_date": "2023-09-23T16:18:46Z",
    "planning_fields": {
        "reason_for_change": {
            "description": "Test"
        },
        "change_impact": {
            "description": "Test"
        },
        "rollout_plan": {
            "description": "Test"
        },
        "backout_plan": {
            "description": "Test"
        }
    },
    "workspace_id": 1
}

Hope this helps!!

1 Like

@Mattia_Piparo Thanks, It works perfectly.

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.