0

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

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

下面是要测试的片段:

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
    }
]

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

4

1 回答 1

0

以下解决方案对我有用:传递事件和值以进行更新。此外,必须通过事件请求 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",
于 2018-11-21T20:41:03.527 回答