Automating Incident Creation on Incident.io with Postman Flows 🚀

:rocket: Automating Incident Creation

With Postman Flows, I designed a system to dynamically create incidents in incident.io. The process involves entering key details, mapping them automatically, and posting them to incident.io seamlessly.

Postman Flows:

Incident.io dashboard:

incident.io flows link

:one: Inputs

You provide the following key details:

  • Incident Type: Define the type of incident.
  • Summary: A brief description of the incident.
  • Severity Name: Specify the severity (e.g., “Critical,” “High”).

:two: :fire: Severity Mapping

Postman Flow retrieves the appropriate Severity ID by mapping the severity name to its corresponding ID in incident.io. This eliminates the need for manual lookups, ensuring accuracy and saving time.

How it works:

  • A GET request fetches the list of severities from incident.io.
  • Postman Flow processes the response to match the severity name with the correct ID.

:three: :inbox_tray: Incident Creation

Once the Severity ID is fetched, a POST request is made to create the incident in incident.io. The payload includes:

  • The Incident Type
  • The Summary
  • The dynamically fetched Severity ID

This ensures that incidents are created correctly and consistently.


Conclusion

While working with the Incident.io API, I learned that creating an incident involves more than a simple POST request. A severity ID needs to be fetched and mapped, and a unique idempotency key (8 characters) is required. These details, though in the documentation, became clearer through Postman Flows.

Postman Flows made it easy to combine steps like fetching severity IDs, creating custom fields, and structuring requests. Overall, this process greatly simplified incident creation and enhanced efficiency. :rocket:

Gladwin

3 Likes

This is a nice use case of Flows. Is there anything that we could’ve done better? Soon we’re launching a way for you to share your flow without a screenshot - look out for that, would love your feedback.

1 Like

Thanks @lunar-module-1

Q1:
I’m new to FQL and have a doubt about using variables in a conditional expression. I’ve tried $level, {{level}}, level, and 'level', but none seem to work. Am I missing something, or is it not possible to use variables this way? What’s the correct syntax?


Q2:
I dropped this idea earlier but now I wonder. can we have dropdown using id and value blocks from GET JSON data?


Q3:
Can the output display act like a form where the user presses a button in the HTML output, and that interaction triggers the rest of the flow?

Also, there are many APIs to add to this flow in the future

  • List item
  • List of incident and update incident and delete incident
  • List of alert
  • Status page display etc…

For now, it is okay I think.

Thanks for your time…

Hi @gladwingt

Q1) level or `level` will work to access the variable. Unfortunately the specific syntax you’re using of filtering the list only supports a literal string and not a variable. This is a limitation of FQL but can be achieved using TypeScript.

data.severities.filter((item) => item.name === level).map((item) => item.id)

Q2) Could you expand a little more on what you mean by this?

Q3) Thank you for this feedback, we will add it as a feature request.

2 Likes

Thanks @flows-daniel

It’s absolutely brilliant, but I need to add [0] to the mapping because I need a string like this:

data.severities.filter((item) => item.name === level).map((item) => item.id)[0]

Q2
About having a dropdown like a string block to select or set severity names fetched via a GET request using id and text variables output variable like selected id or name.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.