cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Best Practice for migrate a item into a new State from old one?

traker99
5-Regular Member

Best Practice for migrate a item into a new State from old one?

Hello and good Day,

 

is there any best practices for how to migrate old issues/Items into a new state? We currently changed some of our Workflows/Types. We will added a new State and will remove a old one.

 

For Example:

- We like to add a new State "Active" which replace "Report_Active" to the type "Report". We will remove the old State "Report_Active" from the type. (It wasnt possible to rename "Report_Active" to "Active".)

 

What is the best way to migrate old items which are still in State "Report_Active" to "Active"? First change the State of the items to the new one and then remove the old state from the type? Or is it possible to to a batch migration afterwards?

 

Thank you very much

 

 

4 REPLIES 4
ascott
17-Peridot
(To:traker99)

The easiest way to do a bulk state change is using a scheduled trigger.

1. Create a query that returns the items you want to change. Something like:

AND

-Type = <your type>

- State = Old State

 

2. Create a new Trigger. Type is "Scheduled", Frequency "Manual", Choose Query created in #1 and then go to the Assignment Tab and add State = <New State>. *Note: No trigger script is required!

 

3. Save the trigger and then right-click on it and do "Run Trigger". Baring any constraint violations, this should change all the states to the assigned value for all items returning in your query. 

 

I would suggest you do the first round with a small subset of your results. (You could limit the results by adding a Create Date ranger filter) Once you've determined it works as expected you can expand the number of items returned by the Query. If you are updating thousands of items, you may want to start small with a few hundred items to get an idea of how long it and increase /decrease as needed.


Hope this helps!
-Andrew

traker99
5-Regular Member
(To:ascott)

Hello ascott,

 

thank you very much for your detailed answer.

 

I do have some questions about this procedure, may i ask them?

 

  • Is there any way to keep the "history" footprint as low as possible?
    We have some triggers running that will change certain items after a change. Is it possible to change Items without running this specific triggers (without deactive them?). Maybe there is a special command like "--import" for the CLI?
  • You said "Baring any constraint violations...", is there a way to do a "Admin Migration" so specific constraints may be ignored? We have plenty of old items which do not satisfy some new constraints we have. It would be very time-consuming to change all this special items manually.

Thank you very much!

ascott
17-Peridot
(To:traker99)

A scheduled assignment trigger will:

  • honor constraints
  • fire triggers
  • store history

editissue --import will

  • honor constraints
  • bypass triggers
  • store history

The nice thing about a scheduled assignment trigger is that no scripting is required! 

-Andrew

 

traker99
5-Regular Member
(To:ascott)

Sorry for the later answer.

 

Thank you very much ascott. We wrotea little java migration tool for our specific needs.

 

Announcements


Top Tags