Auto-Increment Asset ID - Broken in 3.6.3
Expected Behavior (or desired behavior if a feature request)
I expect that when creating a new Asset, my "Asset Name" will be populated with the same number as the "ID" field for that Asset. This is the way Snipe-IT used to work.
Actual Behavior
Since commit - https://github.com/snipe/snipe-it/commit/a8839e0ef412babcd930da1e27c0bd9fed3f4f9d (which I understand fixed Auto Incrementing for many people)
It has my installation generating Asset IDs that are not compatible with my current inventory. Checking the commit I can see that it is generating the next integer from the "Asset ID" column where it used to increment from the "ID" column.
We use alphanumeric "Asset IDs" and this has broken Auto-Increment for us. I have since reverted to using the "ID" column to increment but I do not prefer to have a non-standard configuration. I'd like to discuss reverting this change or making the column that Auto-Increments an option.
I can provide more detailed explanation with screenshots if needed
Thank you so much for all of your hard work.
Can you give me some examples of asset tags as they used to generate, and how they do now? Using the ID doesn't really make sense, which is why we switched it. If you turn on incrementing after you already have some assets with different tags, all of the increments are off, so we can't revert the change.
As a holdover from our previous inventory solution, we used the incrementing feature in a very basic manner.
We take the incremented number and place the shorthand of its "Location" before it, this becomes the machine's hostname as well as its "Asset Tag". We use the "Asset Name" field more freely, using it for either a friendly name "Steve's Computer" or whatever the situation requires
So machine number 1995, purchased by the Grants Management department becomes
GRANTS1995 and it gets added to Active Directory as such.

same example, narrowed to just computers

Now when a new asset is created and the Asset ID increments off the "Asset Tag" column I get the suggestion of 757. Since as you can see, when sorted by "Asset Tag" it considers WELCOME756 to be my "Largest" item when in fact I have 2000 assets.

You can see incrementing from "Asset Tag" suggests 757

While incrementing from "ID" suggests the (proper for my situation) 2001

I also have this problem.
My assets where taking numbers from 0. Now they are taking an upwards of 10000 for some reason. This happened as soon as i updated to 3.6.3.

I have a similar problem. We use ISB + a 5 digit number, e.g. ISB10211 was the last one. Now when I create a new asset it increments the 5 digit number as well as adding another 1 to the beginning.
For example, ISB10211 -> ISB110212 -> ISB1110213 -> ISB1110214 etc.
@snipe Is there any update on this? I'm forced to write down which number i last used! Will it be fixed in v4?
Thanks.
I'm having issues with this as well. I have it with the prefix of HAI-01 and it is stuck at HAI-01002 even though I have assets beyond this.
I'm pretty sure many of these problems are due to inconsistent asset tag lengths in the database. We're basically asking MySQL to select MAX on a string that is non-numeric, and for MySQL, that means that WT9 is going to be higher than WT100 (and so on).
I think what we need to do is something like: select ifnull(max(CONVERT(asset_tag ,SIGNED INTEGER)),0) from asset_tag where asset_tag REGEXP '^[0-9]+$' in the incrementing method in the Asset model, but I haven't had time to work on this yet.
What I'm trying to do is get HAI-01XXX to count up. Right now it is stuck at HAI-01002 and won't count up from there.
-- Ryan Sizemore | IS Support | Haivision O | 1.847.362.6800 x7200 M | 1.224.500.1568* S* | [email protected] http://www.haivision.com
On Wed, May 10, 2017 at 5:29 AM, snipe [email protected] wrote:
I'm pretty sure many of these problems are due to inconsistent asset tag lengths in the database. We're basically asking MySQL to select MAX on a string that is non-numeric, and for MySQL, that means that WT9 is going to be higher than WT100 (and so on).
I think what we need to do is something like: select ifnull(max(CONVERT(asset_tag ,SIGNED INTEGER)),0) from asset_tag where asset_tag REGEXP '^[0-9]+$' in the incrementing method in the Asset model, but I haven't had time to work on this yet.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/snipe/snipe-it/issues/3203#issuecomment-300442000, or mute the thread https://github.com/notifications/unsubscribe-auth/AYev3dy4BIv-ahmnoraEnvArlKfF2uo7ks5r4ZGWgaJpZM4LmQTK .
This should be fixed in the upcoming v4