Get selected option's id of cascading list custom field

Hi,
i have a cascading list custom field for my jira issues and I am trying to get the id of the selected option. Not the value, but the ID.
Is this possible?
Example blow:
i want to get the id of option1 and the id of option 1.2.

Exported in XML format they look like this so I would need to get the key of each customfieldvalue.

Is this possible? Thank you in advance!

The select list cascading custom field looks like this:
image