Hi,<br><br>I have a simple scrip that sets some default values during the creation of a ticket.<br>The problem witht his scrip is that it's a little rough, it sets the values even when somoen manually creates a ticket and fills in the fields (they get overwritten).<br>
<br>Because of that I want the scrip to first check if the field isn't set already, with that I'm kinda having a problem, checking if the field is NULL doesn't seem to work...<br><br>What's the best way for checking if a Custom Field (in this case) isn't set?<br>
<br>I've tried these options but they don't seem to work:<br><br>Check if the field is empty:<br><br><span style="font-family: courier new,monospace;">if($self->TicketObj->FirstCustomFieldValue(Field => 'Type') = 'NULL') { do something };</span><br>
<br>Since this field could contain the option Problem this if statement does something when the ticket is set to Problem (for testing, but this doesn't seem to work either):<br><br><span style="font-family: courier new,monospace;">if($self->TicketObj->FirstCustomFieldValue(Field => 'Type') =~ /^P/) { do something );</span><br>
<br>And a bunch of varaiaties where I\ve either bumped against issues of syntax not being recognised, etc. (things like neq, !=, NULL without quotes, etc.).<br><br>Does anyone have an example on how to do something similar? (check if a CF is empty, if so then fill it with a value)<br>
<br clear="all">-- Bart<br>