How do I get the numeric incident id in an automation?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

How do I get the numeric incident id in an automation?

L0 Member

I'm working with a Python automation, and I need to get the numeric incident id. I expect this id to be numeric (123456) but it is always a long concatenated hex string and GUID.

incident = demisto.incidents()[0]
incident_id = incident['id']
print(incident_id )

Output is: 89a633e1ef019afeee78fbb2ac23ee84$&$234f4f55-5c46-44b1-8662-6f65039a9a0c

I need a ordinal numeric value like #19119 (number seen in incidents list). How are these ids related?

1 accepted solution

Accepted Solutions

L3 Networker

If you are running this command as a test in the playground, the playground always returns this GUID like string.

 

Running it in a real incident should return the incident ID.

 

You can also use demisto.incident() to get the incident data of the incident in which the script is running in (rather than getting all incidents and pulling the first one off the list).

 

Regards


Adam

View solution in original post

1 REPLY 1

L3 Networker

If you are running this command as a test in the playground, the playground always returns this GUID like string.

 

Running it in a real incident should return the incident ID.

 

You can also use demisto.incident() to get the incident data of the incident in which the script is running in (rather than getting all incidents and pulling the first one off the list).

 

Regards


Adam

  • 1 accepted solution
  • 1905 Views
  • 1 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!