Not updating requesters in loop

Hi Guys,

Hope your doing good. I have a requirement where need to iterate all requesters, update custom check value for that requester. in loop if i am trying update custom field check box it is not updating, but status coming as 200. but if i try same body in postman it is updating. Can you guys help me any other work around need to proceed.

This is body i am sending and using v2 API update requester
“custom_fields”: {
“custom_check”: true
Thanks in advance,
Tejasri Kalluri.

1 Like

Can anyone review this?

Hi @Tejasri_Kalluri,

The body for the request seems fine. Could you share a code snippet of the request you are making?

1 Like

As @sarfaraz_Mohammed mentioned, the code snippet of how the loop is performed and how the complete request is made is available, that would help you troubleshoot it further.


Hi @sarfaraz_Mohammed,

Thanks for your response, I am using this API first for requesters in Freshservice
based upon this response iterating requesters and updating requester custom field
For updating requester using this API

Hi @Raviraj,
This is code using in forloop,
var headers = { “Authorization”: “Basic cmZDY0s1cGFRcGJPUmRqclg3aTo=” };
var options = { headers: headers };
var url =${page}&per_page=100;
$request.get(url, options).then(function (data) {
try {
var resp = JSON.parse(data.response);
for (var i = 0; i < resp.requesters.length; i++) {
if (resp.requesters[i].active && resp.requesters[i].custom_fields.custom_check !== null) {
if (resp.requesters[i].custom_fields.custom_check === false)
if (resp.requesters.length === 100) {
page = page + 1;

    } catch (error) {

    function (error) {
      console.log("all contacts error")

and this the update function api call

var headers = { "Authorization": "Basic cmZDY0s1cGFRcGJPUmRqclg3aTo=", 'Content-Type': 'application/json' };

  var body = {

    "custom_fields": {

      "custom_check": true



  var options = { headers: headers, body: JSON.stringify(body) };

  var url = `${id}`;

  $request.get(url, options).then(function (d) {
    console.log(`Updated Requester- ${id} custom check box..................`)
  }, function (error) {
1 Like

Hi @Tejasri_Kalluri

Thanks for sharing the code snippets.
In the request, you are trying to update the custom field. It is a PUT method and not a GET. Can you change that and let us know if it works?


Thanks, @sarfaraz_Mohammed, That was my mistake not to check method