Extracting artifact info before download begins

Hey I am looking for an way to extract the artifact version information before it is downloaded.
This is to show the end-user a pop-up message containing the artifact information using a state-script.
I am using the mender systemd service on ubuntu 18.04.

Does anyone know if and how this information can be read by a custom state-script

The is unfortunately not possible with state scripts. Only Update Modules can do that. Your best bet would be to look at the rootfs-image-v2 Update Module (which is a reimplementation of what is inside the client) and the Update Module File API and tweak the rootfs-image-v2 to check the version information inside the Download state.

See also the chapter about using an Update Module, and the chapter about making one for a gentler introduction to the concept.