Best Practice for workflow asset type id reference

Hello all,

I receieved an email from Freshworks telling me that my workflow may need to be updated because I am using a hardcoded asset type id. I tried to update my workflow according to the email, but I am unable to get it to work.

I am creating a ticket that references an asset of type “Laptop” through an api call in the workflow. I use the payload below to do so:

{
  "description": "Serial Number: {{P1.root.asset.type_fields.serial_number_24000734128}}, OS Version: {{P1.root.asset.type_fields.os_version_24000734133}}",
  "subject": "Laptop needs to be repaired",
  "email": "tom@outerspace.com",
  "priority": 1,
  "status": 2,
  "cc_emails": [
    "ram@freshservice.com",
    "diana@freshservice.com"
  ],
"assets": [ { "display_id": {{P1.root.asset.display_id}} }]
}

My questions are:

  1. Is there any way to dynamically set the type id in the P1.root.asset.type_fields.serial_number_24000734128 and P1.root.asset.type_fields.os_version_24000734133 paths?

  2. What would be the best way to do this, or does it have to be hard coded?

  3. Are these type ids ever updated or changed by freshworks?

  4. Will these ids be replicated over into my sandbox environment?