JupiterOne-Archives / integrations-2021-07-16

JupiterOne integration development documentation and issue tracking
0 stars 2 forks source link

Allow `+` in custom field names array #37

Open aiwilliams opened 3 years ago

aiwilliams commented 3 years ago

It has been reported that custom fields with a + character in the name are not ingested.

The user configures (in the UI) a customFields value (name or id, comma separated) that is validated by the following code:

    for (const f of Array.isArray(fields) ? fields : [fields]) {
      if (f.startsWith("customfield_")) {
        customFields.push(f);
      } else if (f.match(/\d{5}/)) {
        customFields.push(`customfield_${f}`);
      } else {
        customFields.push(camelCase(f));
      }
    }

Perhaps the camelCase() function is the culprit here.

Change the code to support a + character while maintaining whatever was supported by assuming that fields should be made camelCase().

aiwilliams commented 3 years ago

@erkangz would you please elaborate on the reason for calling camelCase() on fields? It seems to me that we should support spaces in names as well as + characters, perhaps others?

aiwilliams commented 3 years ago

The workaround is to obtain the custom field ID.

Screen Shot 2021-05-04 at 12 09 56 PM

erkangz commented 3 years ago

@erkangz would you please elaborate on the reason for calling camelCase() on fields? It seems to me that we should support spaces in names as well as + characters, perhaps others?

I don't think it's necessary for camelCase() in this scenario. Perhaps this is for making standard fields like Description to description when added to the entity?