TheHive case creation with attachment

Hello guys,

Describe the problem/error/question

I’m trying to get e-mails coming to a mailbox thanks to Email trigger (IMAP) node. These e-mails contain an attachment.
What I want is to send this e-mail content + the attachment to my TheHive interconnection, by creating a case.
I can create basic cases, but I can’t create the attachment linked to it by using artifacts.

What is the error message (if any)?

The main problem that I’m having currently is the following one:

Problem in node ‘CreateAlert‘

No binary data exists on item!

Please share your workflow

Information on your n8n setup

  • n8n version: version 0.234.1
  • Database : SQLite
  • Running n8n via : Docker
  • Operating system: Ubuntu 20.04

Thank you very much for the support.

Hey @GGZ78,

It looks like the value you are using for the binary item is not correct, instead of email.eml;message/rfc822;{{ $('EmailTrigger').item.binary['attachment_0']['data']; }} it is normally something like data or attachment. If you check the output of the GenerateUUID node assuming it has a binary data field on it that will show you the value to use.

You can also generate a v4 uuid with the crypto node if you wanted to drop the code node.

Hello Jon,

Thanks for your quick answer.
That’s good to know for the UUID part - I was sure that our dear n8n would implement something like this but couldn’t find it, so I used JS ^^

For the attachment part, I don’t think there is other binary/data. When I retrieve {{ $('EmailTrigger').item.binary }}, I can see a JS object with information such as mimeType, and the data one:

Hey @GGZ78,

You don’t need to put in the variable just the name of the field so for that file you would just need to input attachment_0 and it would work.

Hi dear @Jon,

We are getting closed to what I want!
Indeed, when I direct link the EmailTrigger node to TheHive node and put attachment_0 in the binary field, it’s creating TheHive alert with the file. Wonderful!
The problem is that I need a UUID node between both of them; and then, when I simply put attachment_0, it’s not retrieving it. And it does the same with {{ $node["EmailTrigger"].attachment_0 }}.
Any idea how could I say to my field that I want the attachment_0 from 2 nodes before?

Many thanks!

Hello @Jon,
Could you please provide me the answer to my very last question?
Thank you very much!

Hey @GGZ78,

I missed that reply, You would need to make sure the binary data is on the node before the one you need it. You can do this with a merge node like the example below.

Thank you vey much.
Have a good friday and weekend.

1 Like

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