How to create secure note


#1

Hi,
I’m trying to programically create a secure note, and have got as far as this, but it generates an error:

 bw get template item | jq '.name = "TEST" | .notes = "TEST NOTES" | .secureNote = {"type":0}' | bw encode | bw create item

It generates the error:

UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘uris’ of null

Can any provide working code of how to create a secure note item please?

Regards,
Andy


#2

From another thread, I got the following, which works:

bw get template item | jq ".login = $(bw get template item.login)" | bw encode | bw create item

However,

bw get template item | jq ".secureNote = $(bw get template item.securenote)" | bw encode | bw create item

results in the same uris error


#3

I got there in the end.

For the benefit of people that are stuck in the future, here’s my final code

bw get template item | jq --arg KEY $KEY '.name = $KEY' | jq --arg VAL $VAL '.notes = $VAL' | jq '.type = 2' | jq ".secureNote = $(bw get template item.secureNote)" | bw encode | bw create item