Hello,
I’m relatively new to RT and have been running into this problem for a
few days now. I’ve looked everywhere and haven’t found a clue. The
closest thing I could find was documented in this post:
http://www.mail-archive.com/rt-users@lists.bestpractical.com/msg10037.html
But, I really don’t want to to undo the changes that RT automatically
undoes…
Basically, whenever I make changes to a custom field from a scrip
whatever the value that I add automatically gets reverted back to the
old value. I tried adding code to delete the old value first, but RT
just adds the old value back.
Here’s some psuedocode (code not tested and may contain typos, but my
code works just fine as I can see the transactions in the ticket
history):
my $Value = ‘some value’;
my $CFName = ‘customCF’;
my $CF->LoadByName( Name => $CFName);
#Delete the old value:
$self->TicketObj>DeleteCustomFieldValue(
Field => $CFName,
Value => $self->TicketObj->FirstCustomFieldValue($CFName)
);
#Set the new value:
$self->TicketObj->AddCustomFieldValue( Field => $CF, Value => $Value);
Bottom line: does anyone know how to prevent RT from undoing the
additions to a custom field? This is in RT 4.0.4.
–Matthew.
Hello,
I’m relatively new to RT and have been running into this problem for a
few days now. I’ve looked everywhere and haven’t found a clue. The
closest thing I could find was documented in this post:
Re: [rt-users] custom field resets to previous value after scrip runs
But, I really don’t want to to undo the changes that RT automatically
undoes…
Basically, whenever I make changes to a custom field from a scrip
whatever the value that I add automatically gets reverted back to the
old value. I tried adding code to delete the old value first, but RT
just adds the old value back.
Here’s some psuedocode (code not tested and may contain typos, but my
code works just fine as I can see the transactions in the ticket
history):
my $Value = ‘some value’;
my $CFName = ‘customCF’;
my $CF->LoadByName( Name => $CFName);
#Delete the old value:
$self->TicketObj>DeleteCustomFieldValue(
Field => $CFName,
Value => $self->TicketObj->FirstCustomFieldValue($CFName)
);
#Set the new value:
$self->TicketObj->AddCustomFieldValue( Field => $CF, Value => $Value);
Bottom line: does anyone know how to prevent RT from undoing the
additions to a custom field? This is in RT 4.0.4.
Is this a TransactionCreate/TransactionBatch stage issue?
Tim
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.
Matthew,Tim,
Most likely it is.
KennOn Thu, Jun 14, 2012 at 6:54 AM, Tim Cutts tjrc@sanger.ac.uk wrote:
On 14 Jun 2012, at 14:48, Matthew W. wrote:
Hello,
I’m relatively new to RT and have been running into this problem for a
few days now. I’ve looked everywhere and haven’t found a clue. The
closest thing I could find was documented in this post:
Re: [rt-users] custom field resets to previous value after scrip runs
But, I really don’t want to to undo the changes that RT automatically
undoes…
Basically, whenever I make changes to a custom field from a scrip
whatever the value that I add automatically gets reverted back to the
old value. I tried adding code to delete the old value first, but RT
just adds the old value back.
Here’s some psuedocode (code not tested and may contain typos, but my
code works just fine as I can see the transactions in the ticket
history):
my $Value = ‘some value’;
my $CFName = ‘customCF’;
my $CF->LoadByName( Name => $CFName);
#Delete the old value:
$self->TicketObj>DeleteCustomFieldValue(
Field => $CFName,
Value => $self->TicketObj->FirstCustomFieldValue($CFName)
);
#Set the new value:
$self->TicketObj->AddCustomFieldValue( Field => $CF, Value => $Value);
Bottom line: does anyone know how to prevent RT from undoing the
additions to a custom field? This is in RT 4.0.4.
Is this a TransactionCreate/TransactionBatch stage issue?
Tim
–
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.
Here’s some psuedocode (code not tested and may contain typos, but my
code works just fine as I can see the transactions in the ticket
history):
my $Value = ‘some value’;
my $CFName = ‘customCF’;
my $CF->LoadByName( Name => $CFName);
#Delete the old value:
$self->TicketObj>DeleteCustomFieldValue(
Field => $CFName,
Value => $self->TicketObj->FirstCustomFieldValue($CFName)
);
#Set the new value:
$self->TicketObj->AddCustomFieldValue( Field => $CF, Value => $Value);
When I call AddCustomFieldValue, I use the field name in Field,
rather than an actual CustomField class. So I do things like
$parent->AddCustomFieldValue(“Field” => “custom_status”, “Value” =>
$newStatus);
and that seems to work fine.
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin
Hi,
It’s known issue with scrips that set custom fields based on other
fields. You workaround it either by not allowing people to change
custom fields you auto set with scrips or by running your scrip in
batch stage.
Some details. RT processes updates to custom fields one by one from
request args, your scrip kicks in in the middle and then RT thinks,
when it gets to a field that was changed by a scrip, that user picked
different value and changes it back.On Thu, Jun 14, 2012 at 5:48 PM, Matthew W. matt.k.wong@gmail.com wrote:
Hello,
I’m relatively new to RT and have been running into this problem for a
few days now. I’ve looked everywhere and haven’t found a clue. The
closest thing I could find was documented in this post:
Re: [rt-users] custom field resets to previous value after scrip runs
But, I really don’t want to to undo the changes that RT automatically
undoes…
Basically, whenever I make changes to a custom field from a scrip
whatever the value that I add automatically gets reverted back to the
old value. I tried adding code to delete the old value first, but RT
just adds the old value back.
Here’s some psuedocode (code not tested and may contain typos, but my
code works just fine as I can see the transactions in the ticket
history):
my $Value = ‘some value’;
my $CFName = ‘customCF’;
my $CF->LoadByName( Name => $CFName);
#Delete the old value:
$self->TicketObj>DeleteCustomFieldValue(
Field => $CFName,
Value => $self->TicketObj->FirstCustomFieldValue($CFName)
);
#Set the new value:
$self->TicketObj->AddCustomFieldValue( Field => $CF, Value => $Value);
Bottom line: does anyone know how to prevent RT from undoing the
additions to a custom field? This is in RT 4.0.4.
–Matthew.
Best regards, Ruslan.
Ruslan Zakirov <ruz bestpractical.com> writes:
Hi,
It’s known issue with scrips that set custom fields based on other
fields. You workaround it either by not allowing people to change
custom fields you auto set with scrips or by running your scrip in
batch stage.
Some details. RT processes updates to custom fields one by one from
request args, your scrip kicks in in the middle and then RT thinks,
when it gets to a field that was changed by a scrip, that user picked
different value and changes it back.
Hello,
I’m relatively new to RT and have been running into this problem for a
few days now. I’ve looked everywhere and haven’t found a clue. The
closest thing I could find was documented in this post:
http://www.mail-archive.com/rt-users
lists.bestpractical.com/msg10037.html
But, I really don’t want to to undo the changes that RT automatically
undoes…
Basically, whenever I make changes to a custom field from a scrip
whatever the value that I add automatically gets reverted back to the
old value. I tried adding code to delete the old value first, but RT
just adds the old value back.
Here’s some psuedocode (code not tested and may contain typos, but my
code works just fine as I can see the transactions in the ticket
history):
my $Value = ‘some value’;
my $CFName = ‘customCF’;
my $CF->LoadByName( Name => $CFName);
#Delete the old value:
$self->TicketObj>DeleteCustomFieldValue(
Field => $CFName,
Value => $self->TicketObj->FirstCustomFieldValue($CFName)
);
#Set the new value:
$self->TicketObj->AddCustomFieldValue( Field => $CF, Value => $Value);
Bottom line: does anyone know how to prevent RT from undoing the
additions to a custom field? This is in RT 4.0.4.
–Matthew.
I just upgraded from version 3.6.6 to 4.0.10.
I followed the UPGRADE-X.X.X process.
My problem seems to be what is described above, but I don’t know how to fix it.
The NEW TICKET function worked in 3.6.6 but not in 4.0.10
When I log in I have the option of click a button to create a new ticket.
Next to that button is a dropdown list to indicate the Queue. We have custom
fields defined based on the Queue selected.
No matter what Queue I select it reverts to the first in the list even before
I click the NEW TICKET button.
If I use the Quick Create, I have all my custom fields available and can
update them there.
Any Ideas?
Rolf