Searching for values in a custom field identified by ID?

Hello list.

I’m looking for resolved tickets with the value of 0 in the custom
field called “Invoice no.” like this:
$tickets->FromSQL(’(“CF.{Invoice no.}”=0 AND Status = “Resolved”)’);

The above works, but I would like to refer to the custom field by its
ID. How should i formulate my search?

I’m running RT 3.8.8.

Regards,
Tobias

Hello list.

I’m looking for resolved tickets with the value of 0 in the custom
field called “Invoice no.” like this:
$tickets->FromSQL(‘(“CF.{Invoice no.}”=0 AND Status = “Resolved”)’);

The above works, but I would like to refer to the custom field by its
ID. How should i formulate my search?

Why do you want to use the ID?
If you’re worried about name changes, just load the CF and use the
->Name method to ensure you’re always using the up-to-date name

-kevin

Hello Kevin.

If you’re worried about name changes, just load the CF and use the
->Name method to ensure you’re always using the up-to-date name

I am indeed worried about name changes.

I am afraid your explanation does not make much sense to me as I am an
RT newbie. Are you able to illustrate you suggestion with code?

Thanks,
Tobias

I am indeed worried about name changes.

Did you try CF.42 or CF.{42}?

Thomas