Question

need example of a json body to create change with planning_fields

  • 12 August 2021
  • 5 replies
  • 177 views

Hello,

I've been working on some integrations between freshworks and azuredevops pipelines using the freshworks api v2, but I 'm getting errors everytime time I pass a planning_fields item.

Couldn't find info in the documentation regarding updating these, could anybody send me an example of a json body to pass in the request to create a change request wich includes planning_fields values?

Thanks,

Orlando


5 replies

Userlevel 7
Badge +14

Hello @largeseashells,

Here is an example of the fields in JSON

 

Hope this helps :)

Take care,

Zach

I tried it that way before but get this error:

{"message":"We're sorry, but something went wrong."}

The change is created despite the error message but the planning_fields are not updated.

Below is an example of my POST request body:

{
    "impact":  1,
    "description":  "api test description",
    "priority":  1,
    "subject":  "api test2 subject",
    "planning_fields":  {                            
                            "reason_for_change":  {
                                                      "description_html":  "<div>adsfdasf</div>",
                                                      "description_text":  "adsfdasf"
                                                  },
                            "change_impact":  {
                                                  "description_html":  "<div>adsfdasf</div>",
                                                  "description_text":  "adsffsafs"
                                              },
                            "rollout_plan":  {
                                                 "description_html":  "<div>adsfdasf</div>",
                                                 "description_text":  "adsfdasf"
                                             },
                            "backout_plan":  {
                                                 "description_html":  "<div>adsfdasf</div>",
                                                 "description_text":  "adsfdasf"
                                             },
                "custom_fields": ""
                        },
    "agent_id":  17001345921,
    "change_type":  1,
    "planned_end_date":  "2021-08-09T22:00:00Z",
    "department_id":  17000159772,
    "requester_id":  17001357715,
    "category":  "Software",
    "group_id":  17000291204,
    "status":  1,
    "email":  "myemail@company.com",
    "planned_start_date":  "2021-08-09T21:00:00Z",
    "risk":  1
}

I tried also skipping characters and differente formatting on the html inside description_html but haven’t gotten it to work.

Thanks,

Orlando

 

Userlevel 7
Badge +14

Hello Orlando,

Hmmm that is strange. What I suggest is taking this issue over to the developer community, where we have the DevRel team who can contact those in charge of the API. You can find the community at 

https://community.developers.freshworks.com/ 

If there is an issue with the API they will be able to track it and get it fixed for you.

Take care,

Zach

Userlevel 7
Badge +14

@largeseashells I completely agree with you that there is an issue with hitting this API endpoint. I tried the same POST request and got the same error message but the Change was still created. This is a big issue and you should take it to the developer community as well as support@freshservice.com

Thank you for bringing this into the light. Hopefully it is fixed quickly.

-Zach

Thanks,

Topic created in developer community for reference:

https://community.developers.freshworks.com/t/need-a-change-planning-field-post-request-example/3342

Regards,

Orlando

Reply