Help with workflow with cataloging: adding exported jpgs to existing group

I could use some guidance for archieving this workflow:

I import jpg+raw in DT from my camera, then edit the RAW files, export the jpg in the same folder as the raw files.
I then want this file to be added (via manual import, automatic is not possible) to the existing jpg+raw group “on top” that is as the main item in that group since it. Ideally this happens automatically.

This seems like a pretty sensible and common approach. What I am missing to achieve this?

You may want to consider that the image preview of your edited RAW file is basically the visual representation of your exported jpg. So importing the result of your export feels pretty redundant in terms of visualization. In this case changing the group leader of your group to your edited raw file visually would accomplish what you requested…

Unless you really want the actual exported jpg become part of the group. In that case it’s as simple as importing the jpg and ctrl+Click your image group and the imported jpg and use the grouping keyboard shortcut.

It might even be possible to automate this process with some lua scripting

Yep. GitHub - wpferguson/extra-dt-lua-scripts: Extra lua scripts for darktable that can't or wont be included in the distributed darktable-org/lua-scripts

export2collection: Export an image, then import the result and group with the original.

I don’t use groups for my photos so my answer may not be complete but I shoot RAW + JPG and edit the RAW and export the result as a 16-bit tiff as a from of archival storage (I wouldn’t normally export as a jpg unless I had a specific reason for wanting a compromised image such as posting to the web). And yes DT will add this exported image automatically to the collection in DT.

To achieve this start the script called ext_editor and this action is remembered between sessions, so you only need to do this once.

image

Then in the export module set the target storage to collection. The exported image will be placed into the same folder as the original and will appear in DTs collection. This is a brilliant script that I use all the time.
image