Delete List using automation/command?

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

Delete List using automation/command?

L1 Bithead

Hi All,

 

I wanted to delete a list using a playbook tasks, but I dont find any automation that can achieve it. It only have createList, and remove data from List

 

May I know any workaround for it?

 

Regards,

Jia Kai

1 REPLY 1

L2 Linker

Hey Jia Kai, you could write an automation that makes an API call to delete the list - you'll need to have the Demisto REST API integration configured for this.

The API method used is POST to the following endpoint: /lists/delete (if multi-tenant: /acc_<tenant_name>/lists/delete )

And the request body would be:{"id":"<list_name>"}

 

The basic script would look something like this (add whatever is needed to print a result, set to context, etc.)

 

listName = demisto.args().get("list_name")
body = {"id": listName}

demisto.executeCommand("demisto-api-post", {"uri":"/lists/delete", "body":body})

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!