I was able to change the reference letter by editing the itop-request-mgmnt.xml file in the production path. However putting this file in the extensions directory doesn't change the ref letter.
Maybe i am creating the extension in the wrong way?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Nice to hear you managed to create your module ! Don't hesitate to carefully read the dedicated documentation : Customizing iTop [iTop Documentation]
About the counter reset, the key_value_store table has two columns, you'll just have to reset a field value. Actually we're not using auto increment anymore, as mentioned in the other thread I've linked.
So, you said your class was named "Security", the below query should work ok. Beware that no class instances should exists before running it !!
UPDATE key_value_store
SET value = 0
WHERE namespace = 'ItopCounter'
AND key_name = 'Security';
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I asked previously if you were running iTop 2.7.0+ but you didn't answer, can you confirm this ?
If the answer is yes, what are the different values in DB for key_value_store.key_name ?
If the answer is no, we'll have to change plans :)
i however don't understand what you meant by "Beware that no class instances should exist before running it"
I meant if you have any record for this class that has a reference number, and resets the ref counter you will soon or later generate a duplicate.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i did respond that i am running iTop version 2.7.1
Values in DB for key_value_store is attached.
Thanks for explaining what you meant, this is what i understood it to be but just wanted to be sure. I deleted all Security tickets created before trying to update database.
I am trying to add a new drawer item on the iTop homepage.
I want to duplicate iTop drawer "Problem Management" and name is as "Security Management"
picture show what i am trying to achieve
Have you already tried to create an iTop extension? You'd definitely need to read up on that if you want to do this yourself.
This page is very useful too: https://www.itophub.io/wiki/page?id=latest%3Acustomization%3Axml_reference#fields
The "drawer" is a "MenuGroup".
Thanks Jeffery,
I created an iTop extension for the module i wanted to add to the dashboard and got it working.
Now i just need to change the reference letter for the module and make it start from zero, say T-004849 to X-00001
finally add a logo
thanks!
i have figured out the logo, still need help to change ref letter and start from X-00001
Hello,
About ref field value generation, I imagine your class is a child of the Ticket class, right ?
Also, what is your iTop version, is it post 2.7.0 ?
If the answer to both question is yes, take a look at : Ticket Ref generation
Also about the possibility to reset the counter so it starts back at 1, there was a recent thread about this : https://sourceforge.net/p/itop/discussion/922360/thread/a05ea12b8f/#3246
Hi Pierre.
Yes, my class is a child of ticket class and iTop version is 2.7.1
i have read the links you gave and cannot still make out how to change the reference letter and make it start from X-00001
Attaching my datamodel
To change the letter you'll have to customize the GetTicketRefFormat method, as this is done for other child classes (for example in UserRequest see https://github.com/Combodo/iTop/blob/support/2.7/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml#L1071)
And to start from 1 again, the forum message I linked above gives the answer (reset value for your class in the key_value_store table)
Thanks Pierre,
I was able to change the reference letter by editing the itop-request-mgmnt.xml file in the production path. However putting this file in the extensions directory doesn't change the ref letter.
Maybe i am creating the extension in the wrong way?
managed to fix it... problem was i was using a module from an old iTop version as an extension and didnt contain the GetTicketRefFormat string in it
sorry for the bother.. and thanks...
i will try to reset the ref counter in MySQL and let you know
Hi Pierre,
Thanks for your help so far, to reset ref counter, i dont get any changes using MySql command below:
ALTER TABLE ticket_security auto_increment = 1;
Can you suggest an example MySQL command to reset?
Thanks
i am new to using MySQL
Hello,
Nice to hear you managed to create your module ! Don't hesitate to carefully read the dedicated documentation : Customizing iTop [iTop Documentation]
About the counter reset, the key_value_store table has two columns, you'll just have to reset a field value. Actually we're not using auto increment anymore, as mentioned in the other thread I've linked.
So, you said your class was named "Security", the below query should work ok. Beware that no class instances should exists before running it !!
Hi Pierre,
thanks for the support, i however don't understand what you meant by "Beware that no class instances should exist before running it"
I am attaching some snapshot showing update command didnt work, have also attached snapshot of my iTop config files
I asked previously if you were running iTop 2.7.0+ but you didn't answer, can you confirm this ?
If the answer is yes, what are the different values in DB for key_value_store.key_name ?
If the answer is no, we'll have to change plans :)
I meant if you have any record for this class that has a reference number, and resets the ref counter you will soon or later generate a duplicate.
i did respond that i am running iTop version 2.7.1
Values in DB for key_value_store is attached.
Thanks for explaining what you meant, this is what i understood it to be but just wanted to be sure. I deleted all Security tickets created before trying to update database.
Woops I missed that, my apologies. Now I'm sure :)
Ok, I wanted to see the distinct values for the key_name column so :
SELECT DISTINCT key_name FROM key_value_store;
attached...
I'm confused, seems like not a single Security record was created, right ?
correct, i copied the "problem" module and modified to "security" and it seems to be getting info from the "problem" database.
I see know this as the security ref number sequence continues from where the problem sequence number ends.
I have created a custom sample-security-module and updating it line by line as i should have done in the first place.
Have also installed the toolkit
All done!
Thanks Pierre!
Super ! Thanks & enjoy !