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

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

Participant

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

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

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

Highlighted

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

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!

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

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

 

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

Sorry for the later answer.

 

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