Is it possible to perform that using the iTop toolkit (I am running iTop v2.4.0)? I tried changing delta to "redefine" but received an error from the toolkit.
Thank you in advance and I look forward to hearing from you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have created a module called "modify-change-ticket" with dependency of "itop-change-mgmt/2.4.0" (I'm using simple change management instead of the ITIL one). I have installed the empty module using itop/setup and run the toolkit with the following datamodel XML file:
Application worked perfectly when I create a new change ticket (could display the dropdown list with the specified values ("low", "medium", and "high" )).
Then, I created 3 sample change tickets with the custom "priority" field set to "low", "medium", and
"high" to simulate my production iTop v2.4.0 with existing change tickets that have the "priority" field.
My goal is to change the "priority" field enum value FROM ("low", "medium", and
"high") TO ("1", "2", "3") which would then allow me to modify the dictionary file to map "1" with "low", "2" with "medium", and "3" with "high" instead of displaying a dropdown list of ("high", "low", "medium" since by default sorted in alphabetical order). This will also make it easier for me to implement a method to automatically compute priority based on risk and impact.
When changing the "priority" field enum values FROM ("low", "medium", and
"high") TO ("1", "2", "3") and _delta="define" and there's EXISTING changes with "priority" field enum values ("low", "medium", and "high")
When changing the "priority" field enum values FROM ("low", "medium", and
"high") TO ("1", "2", "3") and _delta="redefine" and there's EXISTING changes with "priority" field enum values ("low", "medium", and "high")
If the toolkit could modify the "priority" field enum values FROM ("low", "medium", and
"high") TO ("1", "2", "3"); Do they map according to the order mentioned in the <values> tag (i.e. 1->low, 2->medium, 3->high) OR the order as displayed in the dropdown list (refer to below image) </values>
I believe it's following the order as displayed in the dropdown list?
Thank you and I look forward to hearing from you.
👍
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Workaround: use dictionary file to map the value appropriately.
For example, low->minor, medium->medium, high->major.
However, I think there's a bug when you want to send email notification since the values are still low, medium, high instead of minor, medium, major.
Beware that on each setup / toolkit run iTop will update the DB according to its datamodel. So if the old enum values are still in the datamodel, the DB field enum values will be updated and old values added again.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
About changing enum possible values : both toolkit and setup won't change existing data (the first one just use the same code as the later, by the way). You seems to have MySQL strict mode, so the alter table is failing if existing data uses enum values that are removed.
You're talking about doing some computation based on enum value, so this is not the answer but the real enum values and displayed labels can be different if you set dictionnary entries.
So here your only solution is to update in 2 steps :
in your custom XML, add new enum value entries, keeping the old ones, run toolkit or setup
modify existing value (use bulk edit or export/import)
remove old values in your custom XML, run toolkit or setup
About computation, you can see what is done on the UserRequest class : priority is computed based on impact and urgency values.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You're welcome :)
This could become a wiki page, and it might in the future... There will be a massive update of the "customize iTop" page by the end of Q1 2020.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I have the following custom field definition:
I'm attempting to change the enum value and update the entire database with the new enum value:
Is it possible to perform that using the iTop toolkit (I am running iTop v2.4.0)? I tried changing delta to "redefine" but received an error from the toolkit.
Thank you in advance and I look forward to hearing from you.
Hello,
More details please...
For example :
Where did you put those pieces of XML ?
What error are you getting ?
Hi Pierre,
Thank you very much for the reply.
Setup and objective
I have created a module called "modify-change-ticket" with dependency of "itop-change-mgmt/2.4.0" (I'm using simple change management instead of the ITIL one). I have installed the empty module using itop/setup and run the toolkit with the following datamodel XML file:
Application worked perfectly when I create a new change ticket (could display the dropdown list with the specified values ("low", "medium", and "high" )).
Then, I created 3 sample change tickets with the custom "priority" field set to "low", "medium", and
"high" to simulate my production iTop v2.4.0 with existing change tickets that have the "priority" field.
My goal is to change the "priority" field enum value FROM ("low", "medium", and
"high") TO ("1", "2", "3") which would then allow me to modify the dictionary file to map "1" with "low", "2" with "medium", and "3" with "high" instead of displaying a dropdown list of ("high", "low", "medium" since by default sorted in alphabetical order). This will also make it easier for me to implement a method to automatically compute priority based on risk and impact.
Problem and error
"high") TO ("1", "2", "3") and _delta="define" and there's EXISTING changes with "priority" field enum values ("low", "medium", and "high")
ERROR:

"high") TO ("1", "2", "3") and _delta="redefine" and there's EXISTING changes with "priority" field enum values ("low", "medium", and "high")
ERROR:
Question
"high") TO ("1", "2", "3"); Do they map according to the order mentioned in the <values> tag (i.e. 1->low, 2->medium, 3->high) OR the order as displayed in the dropdown list (refer to below image)
I believe it's following the order as displayed in the dropdown list?
Thank you and I look forward to hearing from you.
Solved.
Workaround: use dictionary file to map the value appropriately.
For example, low->minor, medium->medium, high->major.
However, I think there's a bug when you want to send email notification since the values are still low, medium, high instead of minor, medium, major.
Actual fix: need to manually interact with MySQL DB
https://stackoverflow.com/questions/15642695/mysql-change-a-column-enum-value/15642970
Beware that on each setup / toolkit run iTop will update the DB according to its datamodel. So if the old enum values are still in the datamodel, the DB field enum values will be updated and old values added again.
Hello,
Many thanks for all these details, really appreciate !
For a start, you don't need to rewrite so much XML : only specify the nodes you're adding or altering.
For the presentation, just do something like :
About changing enum possible values : both toolkit and setup won't change existing data (the first one just use the same code as the later, by the way). You seems to have MySQL strict mode, so the alter table is failing if existing data uses enum values that are removed.
You're talking about doing some computation based on enum value, so this is not the answer but the real enum values and displayed labels can be different if you set dictionnary entries.
So here your only solution is to update in 2 steps :
About computation, you can see what is done on the UserRequest class : priority is computed based on impact and urgency values.
Thank you very much for the help Pierre :)
You're welcome :)
This could become a wiki page, and it might in the future... There will be a massive update of the "customize iTop" page by the end of Q1 2020.
Cool, keep up the good work!