【问题标题】:How to update incident status in BMC Remedy via API?如何通过 API 更新 BMC Remedy 中的事件状态?
【发布时间】:2018-11-21 16:35:50
【问题描述】:

在我的项目中,我们集成了 BMC Remedy API 来创建带有评论和附件的事件、过滤事件、获取事件。所有这些都很好。

现在的要求是通过 API 将已创建事件的状态更新为已关闭。 我正在使用nodejsexpress

下面是要测试的sn-p:

get('INC000000021072', true) // works fine
.then(inc => update(inc, { Status: 'Closed'})) // getting an error - Field ID specified is not found on this form.
.then(() => get('INC000000021072', true))
.then((inc) => console.log(inc));

更新功能:

async function update(incident, values) {
  console.log('update method #############',{ incident, values});
  try{
    const result = await query({
      uri: `HPD:IncidentInterface/${incident.id}`,
      method: 'PUT',
      json: { values },
    });
    console.log(result); // never gets here due to error
  } catch(error) { console.log(error) };
}

更新 我可以使用请求 ID 更新提交者和描述等字段。但无法更新状态。在使用所有分配相关字段更新状态时,出现以下错误:

[
    {
        "messageType": "ERROR",
        "messageText": null,
        "messageAppendedText": "The Assigned Group fields are invalid.  Use the menus for the Support Company, Support Organization, Assigned Group, and Assignee fields or the type ahead return function on the Assigned Group or Assignee fields to select this information.",
        "messageNumber": 1291053
    }
]

是否有用于更新事件状态的特定界面?是否需要发送任何其他字段以更新事件状态?

【问题讨论】:

    标签: node.js express remedy bmc


    【解决方案1】:

    以下解决方案适用于我:传递事件和值以进行更新。此外,必须传递事件请求 ID 才能更新事件。

    async function update(incident, values) {
      try{
        await query({
          uri: `HPD:IncidentInterface/${incident.requestId}`,
          method: 'PUT',
          json: { values },
        });
      } catch(error) { console.log(error) };
    }
    

    要更新状态,需要通过以下字段:

    Status: "Closed",
          'Assigned Group': "xxxxx",
          Assignee: "xxxxx",
          'Assignee Login ID': "xxxxx",
          'Assigned Support Company': "xxxxx",
          'Assigned Support Organization': "xxxxx",
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-24
      • 1970-01-01
      • 1970-01-01
      • 2023-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-04
      相关资源
      最近更新 更多