We want to be able to send custom notifications when a case is re-assigned to another user. The built in SecOps notification leaves a little to be desired. Can I pull case wall, or some other status change info from a job? I have tried get_case_comments, get_case_tasks, get_case_by_Id, and none seem to have the status change info I am looking for.
Can I pull Case wall info from a job?
Best answer by ylandovskyy
Is there more documentation on how to store context? Its not very clear from looking at the sync incidents job.
There are 2 methods that are responsible for this: "get_job_context_property" and "set_job_context_property".
The structure for the methods is like this:
self.soar_job.set_job_context_property(
identifier=self.name_id, // this is always the same
property_key="string that represents the the entry in the database, where the JSON will be stored",
property_value=json.dumps({json object that you want to set}),
)self.soar_job.get_job_context_property(
identifier=self.name_id,
property_key="string that represents the the entry in the database, where the JSON will be stored"
)
So, if you want to create a DB entry in the context of the job called "case_state", then you would do something like this:
self.soar_job.set_job_context_property(
identifier=self.name_id,
property_key="case_state",
property_value=json.dumps([
{
"caseId": "1",
"assignee": "user1@example"
},
{
"caseId": "2",
"assignee": "user2@example"
}
]),
)
And if you want to get back the data, you would do this:
self.soar_job.get_job_context_property(
identifier=self.name_id,
property_key="case_state",
)
We are working on proper dev guides for different integration components and when will have it ready, there will be more elaborate explanation for the Jobs, but hopefully this will push you in the right direction.
Eventually, you are not bound only to the DB context. You can build the same workflow using the file system or bucket, which will be used to store information about case state.
Login to the community
Login with SSO
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
