Custom ticket rule to auto populate labels assigned to the submitter's machine into a custom field in a ticket
I have been trying to figure out a way to auto populate all labels assigned to the ticket submitter's machine. I am new to sql and I just know basic operations. My idea is to do something like this:
select ID, submitter_ID, MACHINE_ID, CUSTOM_FIELD_VALUE0 from HD_TICKET where HD_QUEUE_ID=19
Then for every ID in that table I want to edit the value of CUSTOM_FIELD_VALUE0 to show the Labels assigned to that MACHINE_D .. something like this: select NAME from LABEL where LABEL.ID=(select LABEL_ID from MACHINE_LABEL_JT where MACHINE_ID=HD_TICKET.MACHINE_ID)
.. but i still cannot get it to work, bear in mind that there might be more than 1 label attached to 1 MACHINE_ID.
Any help is much appreciated.