Forum Discussion
3 years ago
Hey @unrob:
Thanks for the additional feedback!
Jack
I'm reading the output of op item get
(v2.6.0) and adding a brand new field to an existing section using jq
. It looks like this:
\nop item get \"top-secret\" |
\n jq '.fields + [{
\n id: \"my-new-field\",
\n type: \"STRING\",
\n purpose: \"\",
\n label: \"my-new-field\",
\n value: \"very secret\",
\n }]' |
\n op item edit \"top-secret\"
\n
This runs fine, a new version is generated but my-new-field
is not present in the 1password item. Changing values that are already present in the item works fine, just adding new ones silently fails. Anyone knows if this is the expected behavior?
I've verified the resulting json by creating with it a new item, but would like to avoid deleting an existing one to keep versions linked. I've also made a gnarly jq filter to turn JSON into shell arguments for op item edit
, but it honestly feels like a horrible hack I'd rather not maintain.
Would appreciate any guidance!
\n\n1Password Version: 8.8.0
\nExtension Version: Not Provided
\nOS Version: macOS 12.4
\nBrowser:_ Not Provided