3 Replies Latest reply on Nov 6, 2013 1:01 PM by dmshimself

    How best to reference a number between 10000-99999 that can't be repeated

    Apprentice

      Hi group,

       

      I think that this might be a rather basic question - but we have a # that needs to be assigned to a CI and this number cannot ever be repeated for any other CI on the list. I want to create an attribute or object that will best enforce this rule.

       

      - Obviously lists won't work, as I'm not prepared to make 9000 unique entries.

      - Is a text string something that is normally used for this purpose?

       

      Looking for suggestions.

       

      Best,

      Chad.

        • 1. Re: How best to reference a number between 10000-99999 that can't be repeated
          dmshimself ITSMMVPGroup

          You could try adding a 32 integer attribute (not a short 16 bit one) with CreateIdentity Persistence on the business object that holds the configuration item you want.  This gives you a unique number within each CI Type.  SO PC 1, PC 2 and Server 1 and Server 2.  It's initially 0, but you can set this to be some other number via a script (similar to the one used to clear down systems and set the incident reference back to 0) and the rest will be taken care of for you each time a CI is saved.

           

          There was an issue when I did this a while back with a fairly elderly release and you couldn't do this on the Configuration Item object itself, which is *really* what you want to give you a number that gets incremented across the whole of the CI set, no matter what the CI Type.  This might well be fixed now, but worth testing out in your UAT environment and discussing with support.

          • 2. Re: How best to reference a number between 10000-99999 that can't be repeated
            Apprentice

            Hi dmshimself,

             

            Thanks for the reply. I should have mentioned that this number is not incremental. These would be assigned ad-hoc when CIs are imported. They would be defined during impot (excel)

             

            I simply want to know if there's a way to tell a record for an attribute never to duplicate an entry. So if there's already a PC32 in my Title attribute, and I try to import another PC32, it will somehow alert me or make it unable to create the record.

             

            Best,

            Chad.

            • 3. Re: How best to reference a number between 10000-99999 that can't be repeated
              dmshimself ITSMMVPGroup

              Oh I see - humm tricky.  You will be prevented from creating a CI with the same Name field, that has to be unique.  So manually that works if you try to create a new CI with the same contents of the Name field.  But if you are using import and your magic number imports into the Name field and this is also the key for your import, the import will not log errors, it will simply think this is an update and update that record.

               

              I thin you'll have to import via a different method if you want to stop this sort of thing from happening or have any degree of control over what you want import to do