How to update incident status in BMC Remedy via API?

2.4k views Asked by At

In my project we've integrated BMC Remedy API to create incident with comment and attachment, filter incidents, get incident. All these works fine.

Now the requirement is to update status of an created incident to closed via API. I am using nodejs and express.

Below is the snippet to test:

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));

Update function:

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) };
}

Update I am able to update fields like submitter and description with request id. But not able to update status. While updating status with all the assign related field I am getting below error:

[
    {
        "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
    }
]

Is there a specific interface to use to update incident status ? Are there any other fields required to send to update incident status ?

1

There are 1 answers

0
Valay On BEST ANSWER

Below solution works for me: Pass an incident and values to update. Also, incident request ID is mandatory to pass to update the incident.

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

To update the status below fields are required to pass:

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