powershell - 更改 json 值
问题描述
是否可以更改 json 文件中的值。
一点点背景知识我可以使用他们的 api 从 Freshdesk 中提取票证数据。工单的状态以数字形式出现。因此,例如,“开放”票的值为 2。我希望它实际上说开放而不是两个。有什么想法吗?
解决方案
您可以维护一张地图并每次都对照它进行检查。例如
const getType = t => ({
2: "Open",
3: "Pending",
4: "Resolved",
5: "Closed"
})[t]
;
推荐阅读
- azure-devops - Azure DevOps 和 Teams - 一个组组来控制两者的成员资格
- python - 如何有效比较所有模型的准确性
- netlogo - 如何在带有另一个变量的补丁中计算具有某个变量的海龟?
- c# - 如何缩短到属性的路径?
- sql - sql oracle:当类型不存在时获取空值
- c# - 找不到非核心应用程序的模块“AspNetCoreModule”
- css - MacOS Chrome 水平滚动条没有消失
- java - Spring Security 和 Oauth2 的误区
- c# - 具体如果条件评估不正确
- dart - Flutter - 使用 package_info 在 iOS 中获取应用程序版本