首页 > 解决方案 > 更改 json 值

问题描述

是否可以更改 json 文件中的值。

一点点背景知识我可以使用他们的 api 从 Freshdesk 中提取票证数据。工单的状态以数字形式出现。因此,例如,“开放”票的值为 2。我希望它实际上说开放而不是两个。有什么想法吗?

标签: powershellpowershell-2.0powershell-3.0freshdesk

解决方案


您可以维护一张地图并每次都对照它进行检查。例如

const getType = t => ({ 
    2: "Open",
    3: "Pending",
    4: "Resolved",
    5: "Closed"
  })[t]
;

推荐阅读