Skip to content

In otrs/objects.py, assumptions made by "autocast" are error-prone (for values with a leading zero) #48

@vincentborghi

Description

@vincentborghi

In my use case, I have a dynamic field "SR Number" which stores some external ticket number. The fact is that those ticket numbers are made of digits only and may begin with "0" (zero), like e.g. "01234567".
When I search for tickets whose dynamic field "SR Number" is e.g. "01234567", this fails, because autocast changes the string value "01234567" to the "1234567" int, while I need it just stays as it is (the string "01234567").

I was obliged to modify the autocast function (in otrs/objects.py) by adding the 2 following lines just before the "try" statement:
if s.startswith("0"):
return s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions