Transferring CustomField Values from old to new on all tickets in a queue

We are using RT 3.6.4 and what we are trying to do is to synchronize
custom field across all queues and basically have one unique custom
field and type. Currently we have some CFs with the same name and
different types dupe’ed across all the queues. Is there a way we can
script around to move all the values from oldCF to new CF on all tickets
in a Queue ?

For e.g.:
CF Name XYZ, Type: Enter multiple values
CF Name XYZ, Type: Text
Move all the values on XYZ(enter multiple values) to the CF XYZ(Text)
on all tickets in a Queue.

Once this is done we will disconnect the old CF XYZ(Enter multiple
values) from the Queue.

Thanks for your help

THE INFORMATION CONTAINED IN THIS MESSAGE AND ANY ATTACHMENT MAY BE PRIVILEGED, CONFIDENTIAL, PROPRIETARY OR OTHERWISE PROTECTED FROM DISCLOSURE. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, copying or use of this message and any attachment is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and permanently delete it from your computer and destroy any printout thereof.

Subbaraman,

Yes. I've been thru this several times. Each time I found a better 

way to do it. First off, you have to decide what the CF name will be for
ALL the queues that will be using it. Secondly, you have to have a
consensus on the values you will allow. Third, you create the NEW CF and
it’s values. Now, if you have a CF that already exists and you want to
use it, then you still need to set up all the values. The last step is
to APPLY this particular CF to all the queues that will be using it.
Once that is done, set up some scripts (NOT scrips) that detail which
OLD CF"s should be WHAT VALUE for the NEW CF. Once that is done, you
execute each of those scripts for EACH queue by running a query to pull
ALL tickets of each queue (1 queue at a time) and use the "bulk update"
feature to set the new value for the new CF based on the
script/selection criteria for the OLD CF.
For example. Let’s say I have 3 CF’s that are similar. I take CF1
and set up all the values I want it to have. If there are any values I
want to get rid of, I add the news ones first, then run a Search/Bulk
Update to change the values I want to get rid of to the new values.
Select all tickets where CF1 value = “X”. Bulk Update the results to be
CF1 value = “Y”. This would be the basic routine you walk thru for EACH
and EVERY value of CF2 and CF3 for Each Queue that uses CF2 and CF3, 1
Queue at a time.
That should do it. There are no real shortcuts that I know of for
this kind of thing. You COULD use SQL and do this DIRECTLY to the
DataBase, but that get REAL messy and I do NOT recommend it.
Hope this helps.

Kenn
LBNLOn 3/20/2009 7:42 AM, Venkateswaran, Subbaraman wrote:

We are using RT 3.6.4 and what we are trying to do is to synchronize
custom field across all queues and basically have one unique custom
field and type. Currently we have some CFs with the same name and
different types dupe’ed across all the queues. Is there a way we can
script around to move all the values from oldCF to new CF on all
tickets in a Queue ?

For e.g.:
CF Name XYZ, Type: Enter multiple values
CF Name XYZ, Type: Text
Move all the values on XYZ(enter multiple values) to the CF XYZ(Text)
on all tickets in a Queue.

Once this is done we will disconnect the old CF XYZ(Enter multiple
values) from the Queue.

Thanks for your help

THE INFORMATION CONTAINED IN THIS MESSAGE AND ANY ATTACHMENT MAY BE
PRIVILEGED, CONFIDENTIAL, PROPRIETARY OR OTHERWISE PROTECTED FROM
DISCLOSURE. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination,
distribution, copying or use of this message and any attachment is
strictly prohibited. If you have received this message in error,
please notify us immediately by replying to the message and
permanently delete it from your computer and destroy any printout thereof.


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Ken Thanks for your suggestions. Just thought of sharing the path we
took to fix this issue…

  1. Basically we identified that one unique CF that we want across all
    queues
  2. Added it to the Queue
  3. Ran a script to copy data from the old CF to the new CF on all
    tickets in this queue. This we did it using a template that we found in
    RT wiki
    http://wiki.bestpractical.com/view/ImportCustomFieldValues
    and basically used the HasEntry, AddCustomFieldValue methods from
    objectcustomfieldvalues to accomplish this.
  4. Detached the old CF from the Queue.

What we are planning is to do the same for all dup’ed CFs on all the
queue. Many one time effort but could pay us in long run on ease of
maintenance.

Thanks
SubbaFrom: Ken Crocker [mailto:kfcrocker@lbl.gov]
Sent: Friday, March 20, 2009 2:21 PM
To: Venkateswaran, Subbaraman
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Transferring CustomField Values from old to new
on all tickets in a queue

Subbaraman,

Yes. I've been thru this several times. Each time I found a better

way to do it. First off, you have to decide what the CF name will be for
ALL the queues that will be using it. Secondly, you have to have a
consensus on the values you will allow. Third, you create the NEW CF and
it’s values. Now, if you have a CF that already exists and you want to
use it, then you still need to set up all the values. The last step is
to APPLY this particular CF to all the queues that will be using it.
Once that is done, set up some scripts (NOT scrips) that detail which
OLD CF"s should be WHAT VALUE for the NEW CF. Once that is done, you
execute each of those scripts for EACH queue by running a query to pull
ALL tickets of each queue (1 queue at a time) and use the "bulk update"
feature to set the new value for the new CF based on the
script/selection criteria for the OLD CF.
For example. Let’s say I have 3 CF’s that are similar. I take CF1
and set up all the values I want it to have. If there are any values I
want to get rid of, I add the news ones first, then run a Search/Bulk
Update to change the values I want to get rid of to the new values.
Select all tickets where CF1 value = “X”. Bulk Update the results to be
CF1 value = “Y”. This would be the basic routine you walk thru for EACH
and EVERY value of CF2 and CF3 for Each Queue that uses CF2 and CF3, 1
Queue at a time.
That should do it. There are no real shortcuts that I know of for
this kind of thing. You COULD use SQL and do this DIRECTLY to the
DataBase, but that get REAL messy and I do NOT recommend it.
Hope this helps.

Kenn
LBNL

Subbaraman,

You said you "added the CF to the Queue". If this CF will be used 

for ALL queues, then you should make it a “Global” CF. If you try to
copy CF data from Queue 1, where it IS applied, to Queue 2, where it is
NOT applied, you won’t get the results you want. The CF has to be
applied to ALL queues where it will be used. just a thought.

Kenn
LBNLOn 3/26/2009 11:01 AM, Venkateswaran, Subbaraman wrote:

Ken Thanks for your suggestions. Just thought of sharing the path we
took to fix this issue…

  1. Basically we identified that one unique CF that we want across all
    queues
  2. Added it to the Queue
  3. Ran a script to copy data from the old CF to the new CF on all
    tickets in this queue. This we did it using a template that we found
    in RT wiki
    http://wiki.bestpractical.com/view/ImportCustomFieldValues
    and basically used the HasEntry, AddCustomFieldValue methods from
    objectcustomfieldvalues to accomplish this.
  4. Detached the old CF from the Queue.

What we are planning is to do the same for all dup’ed CFs on all the
queue. Many one time effort but could pay us in long run on ease of
maintenance.

Thanks
Subba


From: Ken Crocker [mailto:kfcrocker@lbl.gov]
Sent: Friday, March 20, 2009 2:21 PM
To: Venkateswaran, Subbaraman
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Transferring CustomField Values from old to
new on all tickets in a queue

Subbaraman,

Yes. I've been thru this several times. Each time I found a better 

way to do it. First off, you have to decide what the CF name will be
for ALL the queues that will be using it. Secondly, you have to have a
consensus on the values you will allow. Third, you create the NEW CF
and it’s values. Now, if you have a CF that already exists and you
want to use it, then you still need to set up all the values. The last
step is to APPLY this particular CF to all the queues that will be
using it. Once that is done, set up some scripts (NOT scrips) that
detail which OLD CF"s should be WHAT VALUE for the NEW CF. Once that
is done, you execute each of those scripts for EACH queue by running a
query to pull ALL tickets of each queue (1 queue at a time) and use
the “bulk update” feature to set the new value for the new CF based on
the script/selection criteria for the OLD CF.
For example. Let’s say I have 3 CF’s that are similar. I take CF1
and set up all the values I want it to have. If there are any values I
want to get rid of, I add the news ones first, then run a Search/Bulk
Update to change the values I want to get rid of to the new values.
Select all tickets where CF1 value = “X”. Bulk Update the results to
be CF1 value = “Y”. This would be the basic routine you walk thru for
EACH and EVERY value of CF2 and CF3 for Each Queue that uses CF2 and
CF3, 1 Queue at a time.
That should do it. There are no real shortcuts that I know of for
this kind of thing. You COULD use SQL and do this DIRECTLY to the
DataBase, but that get REAL messy and I do NOT recommend it.
Hope this helps.

Kenn
LBNL

On 3/20/2009 7:42 AM, Venkateswaran, Subbaraman wrote:

We are using RT 3.6.4 and what we are trying to do is to synchronize
custom field across all queues and basically have one unique custom
field and type. Currently we have some CFs with the same name and
different types dupe’ed across all the queues. Is there a way we can
script around to move all the values from oldCF to new CF on all
tickets in a Queue ?

For e.g.:
CF Name XYZ, Type: Enter multiple values
CF Name XYZ, Type: Text
Move all the values on XYZ(enter multiple values) to the CF XYZ(Text)
on all tickets in a Queue.

Once this is done we will disconnect the old CF XYZ(Enter multiple
values) from the Queue.

Thanks for your help

THE INFORMATION CONTAINED IN THIS MESSAGE AND ANY ATTACHMENT MAY BE
PRIVILEGED, CONFIDENTIAL, PROPRIETARY OR OTHERWISE PROTECTED FROM
DISCLOSURE. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination,
distribution, copying or use of this message and any attachment is
strictly prohibited. If you have received this message in error,
please notify us immediately by replying to the message and
permanently delete it from your computer and destroy any printout
thereof.


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

THE INFORMATION CONTAINED IN THIS MESSAGE AND ANY ATTACHMENT MAY BE
PRIVILEGED, CONFIDENTIAL, PROPRIETARY OR OTHERWISE PROTECTED FROM
DISCLOSURE. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination,
distribution, copying or use of this message and any attachment is
strictly prohibited. If you have received this message in error,
please notify us immediately by replying to the message and
permanently delete it from your computer and destroy any printout thereof.

Well it is not actually all queues. It is for those queues that uses
that CF. For example we have a CF called “Release Summary” and around 6
queues in our system uses this field. We copied the data from the
"Release Summary" CF (type enter multiple) to “Release Summary” CF (type
text) on all tickets in one particular queue. We did not copy CF values
from one queue to another. Finally once the copying is all completed, we
detached the “Release Summary” (type enter multiple) from the queue.

The actual problem was that when people copy/paste text into this field
R was showing them as dupes with bullets since it was of wrong type.

ThanksFrom: Ken Crocker [mailto:kfcrocker@lbl.gov]
Sent: Thursday, March 26, 2009 2:57 PM
To: Venkateswaran, Subbaraman
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Transferring CustomField Values from old to new
on all tickets in a queue

Subbaraman,

You said you "added the CF to the Queue". If this CF will be used

for ALL queues, then you should make it a “Global” CF. If you try to
copy CF data from Queue 1, where it IS applied, to Queue 2, where it is
NOT applied, you won’t get the results you want. The CF has to be
applied to ALL queues where it will be used. just a thought.

Kenn
LBNL

Subbaraman,

AH! I see. Sounds like you have it fixed now. Good luck.

Kenn
LBNLOn 3/26/2009 12:04 PM, Venkateswaran, Subbaraman wrote:

Well it is not actually all queues. It is for those queues that uses
that CF. For example we have a CF called “Release Summary” and around
6 queues in our system uses this field. We copied the data from the
"Release Summary" CF (type enter multiple) to “Release Summary” CF
(type text) on all tickets in one particular queue. We did not copy CF
values from one queue to another. Finally once the copying is all
completed, we detached the “Release Summary” (type enter multiple)
from the queue.

The actual problem was that when people copy/paste text into this
field R was showing them as dupes with bullets since it was of wrong type.

Thanks


From: Ken Crocker [mailto:kfcrocker@lbl.gov]
Sent: Thursday, March 26, 2009 2:57 PM
To: Venkateswaran, Subbaraman
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Transferring CustomField Values from old to
new on all tickets in a queue

Subbaraman,

You said you "added the CF to the Queue". If this CF will be used 

for ALL queues, then you should make it a “Global” CF. If you try to
copy CF data from Queue 1, where it IS applied, to Queue 2, where it
is NOT applied, you won’t get the results you want. The CF has to be
applied to ALL queues where it will be used. just a thought.

Kenn
LBNL

On 3/26/2009 11:01 AM, Venkateswaran, Subbaraman wrote:

Ken Thanks for your suggestions. Just thought of sharing the path we
took to fix this issue…

  1. Basically we identified that one unique CF that we want across all
    queues
  2. Added it to the Queue
  3. Ran a script to copy data from the old CF to the new CF on all
    tickets in this queue. This we did it using a template that we found
    in RT wiki
    http://wiki.bestpractical.com/view/ImportCustomFieldValues
    and basically used the HasEntry, AddCustomFieldValue methods from
    objectcustomfieldvalues to accomplish this.
  4. Detached the old CF from the Queue.

What we are planning is to do the same for all dup’ed CFs on all the
queue. Many one time effort but could pay us in long run on ease of
maintenance.

Thanks
Subba


From: Ken Crocker [mailto:kfcrocker@lbl.gov]
Sent: Friday, March 20, 2009 2:21 PM
To: Venkateswaran, Subbaraman
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Transferring CustomField Values from old to
new on all tickets in a queue

Subbaraman,

Yes. I've been thru this several times. Each time I found a 

better way to do it. First off, you have to decide what the CF name
will be for ALL the queues that will be using it. Secondly, you have
to have a consensus on the values you will allow. Third, you create
the NEW CF and it’s values. Now, if you have a CF that already exists
and you want to use it, then you still need to set up all the values.
The last step is to APPLY this particular CF to all the queues that
will be using it. Once that is done, set up some scripts (NOT scrips)
that detail which OLD CF"s should be WHAT VALUE for the NEW CF. Once
that is done, you execute each of those scripts for EACH queue by
running a query to pull ALL tickets of each queue (1 queue at a time)
and use the “bulk update” feature to set the new value for the new CF
based on the script/selection criteria for the OLD CF.
For example. Let’s say I have 3 CF’s that are similar. I take CF1
and set up all the values I want it to have. If there are any values
I want to get rid of, I add the news ones first, then run a
Search/Bulk Update to change the values I want to get rid of to the
new values. Select all tickets where CF1 value = “X”. Bulk Update the
results to be CF1 value = “Y”. This would be the basic routine you
walk thru for EACH and EVERY value of CF2 and CF3 for Each Queue that
uses CF2 and CF3, 1 Queue at a time.
That should do it. There are no real shortcuts that I know of for
this kind of thing. You COULD use SQL and do this DIRECTLY to the
DataBase, but that get REAL messy and I do NOT recommend it.
Hope this helps.

Kenn
LBNL

On 3/20/2009 7:42 AM, Venkateswaran, Subbaraman wrote:

We are using RT 3.6.4 and what we are trying to do is to synchronize
custom field across all queues and basically have one unique custom
field and type. Currently we have some CFs with the same name and
different types dupe’ed across all the queues. Is there a way we can
script around to move all the values from oldCF to new CF on all
tickets in a Queue ?

For e.g.:
CF Name XYZ, Type: Enter multiple values
CF Name XYZ, Type: Text
Move all the values on XYZ(enter multiple values) to the CF
XYZ(Text) on all tickets in a Queue.

Once this is done we will disconnect the old CF XYZ(Enter multiple
values) from the Queue.

Thanks for your help

THE INFORMATION CONTAINED IN THIS MESSAGE AND ANY ATTACHMENT MAY BE
PRIVILEGED, CONFIDENTIAL, PROPRIETARY OR OTHERWISE PROTECTED FROM
DISCLOSURE. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination,
distribution, copying or use of this message and any attachment is
strictly prohibited. If you have received this message in error,
please notify us immediately by replying to the message and
permanently delete it from your computer and destroy any printout
thereof.


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

THE INFORMATION CONTAINED IN THIS MESSAGE AND ANY ATTACHMENT MAY BE
PRIVILEGED, CONFIDENTIAL, PROPRIETARY OR OTHERWISE PROTECTED FROM
DISCLOSURE. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination,
distribution, copying or use of this message and any attachment is
strictly prohibited. If you have received this message in error,
please notify us immediately by replying to the message and
permanently delete it from your computer and destroy any printout
thereof.

THE INFORMATION CONTAINED IN THIS MESSAGE AND ANY ATTACHMENT MAY BE
PRIVILEGED, CONFIDENTIAL, PROPRIETARY OR OTHERWISE PROTECTED FROM
DISCLOSURE. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination,
distribution, copying or use of this message and any attachment is
strictly prohibited. If you have received this message in error,
please notify us immediately by replying to the message and
permanently delete it from your computer and destroy any printout thereof.