Giter Site home page Giter Site logo

Comments (5)

npratley avatar npratley commented on July 28, 2024

Hi @crackytsi, quick question about checking for the existence of a tag attribute on a case. The tags attribute of the Case class is just a list, so you can check that with 'tagname' in case.tags but I can happily add a has_tag() method to do that if preferred.

Or did you mean to search for all cases with a given tag? If so I think you'll need to use the find_cases() method but I'm not exactly sure how to search by tag, would have to check the docs.

from thehive4py.

crackytsi avatar crackytsi commented on July 28, 2024

Actually both :)
The search itself is really ugly and a wrapper class could be more than usefull.
As I wrote a tool that synchronizes with TheHive I required both functionalities.
A hasTag function is of course not needed, but nice to have :)

from thehive4py.

npratley avatar npratley commented on July 28, 2024

Thanks for the reply. The search improvements probably need to be split out to a separate issue, I'm not familiar enough with how it works now but can have a look.

Regarding finding all Tasks of a Case, is there something that get_case_tasks() doesn't provide?

from thehive4py.

crackytsi avatar crackytsi commented on July 28, 2024

So as far as I see not :)

from thehive4py.

nadouani avatar nadouani commented on July 28, 2024

@crackytsi So to answer your questions, please see below

Check for existens of an Tag attribute on a case

You can fetch the case by ID and check its tag attribute

Find all Tasks of a Case

You can use TheHiveApi.get_case_tasks method

Get technical ID of UI caseID

You can find the case by using TheHiveApi.find_first(query=Eq('caseId', 2)) method

Get UI caseID of technical CaseId

You can find the case TheHiveApi.find_first(query=Id('CASE_INTERNAL ID')) and get the caseId property of it

Iterate over task-log entries within a task.

You can use TheHiveApi.get_task_logs method

Add, removed, Edit a customField

You can update the case's customField attribute (could be improved later in fact)

from thehive4py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.