【问题标题】:" Mandatory fields missing" error while using ServiceNow API使用 ServiceNow API 时出现“缺少必填字段”错误
【发布时间】:2020-10-21 22:43:32
【问题描述】:

我正在使用 ServiceNow API 创建目录请求。

网址:

https://<ServiceNow>/api/sn_sc/servicecatalog/items/6e2cc01d4f51ce08d4fb2b8ca310c7a6/order_now

身体:

{
    "sysparm_quantity":"1",
    "variables":  {
        "requestor":"6e2cc01d4f51ce08d4fb2b8ca310c7a6",
        "Requested For":"6e2cc01d4f51ce08d4fb2b8ca310c7a6",
        "Group Name":"01304c6ddbef9f0827673672399619c4",
        "Group Domain":"FG",
        "Rationale for Approver Only (this will not be viewed by fulfillment team)":"testing"
    }
}

我收到了这个错误:

{
    "error": {
        "detail": "",
        "message": "Mandatory Variables are required"
    },
    "status": "failure"
}

我怎么知道什么是必填字段?

【问题讨论】:

标签: servicenow servicenow-rest-api


【解决方案1】:

我发现这个 ID 将用于获取强制变量。 https://&lt;ServiceNow&gt;/api/sn_sc/servicecatalog/items/&lt;Item_ID&gt;/variables

但是,我在 service now 官方文档中没有找到它。

它应该是一个脚本 API。

【讨论】:

  • 非常感谢!
【解决方案2】:

在您打开表单时检查浏览器中的元素选项卡(Chrome 为 F12)并在其中搜索“variable_tab”,您将看到所有预期的变量。您可以通过查看表单来了解强制项是如何被调用的。

【讨论】:

    猜你喜欢
    • 2012-04-02
    • 1970-01-01
    • 1970-01-01
    • 2016-06-09
    • 1970-01-01
    • 1970-01-01
    • 2021-10-03
    • 2018-07-19
    • 2014-08-02
    相关资源
    最近更新 更多