ServiceDesk

 View Only
Expand all | Collapse all

Sorting categories in Hierarchy Tree and deleting incidents

  • 1.  Sorting categories in Hierarchy Tree and deleting incidents

    Posted Dec 17, 2009 08:14 PM

    Hi, I have few questions:

    1. Does anyone know how to sort categories in hierarchy tree? I entered the data in order, but when I saved it, it came out random.
    2. I want to delete all the incidents I created for testing the workflow. Is there any way to do it besides having to delete all data from Ensemble database?



  • 2.  RE: Sorting categories in Hierarchy Tree and deleting incidents

    Posted Dec 17, 2009 09:15 PM

    Finally I figured how to sort. So what's left is how to delete all the incidents. If I have to delete the data from Ensemble directly, what are the list of tables the data should be deleted from?
    Thanks



  • 3.  RE: Sorting categories in Hierarchy Tree and deleting incidents

    Posted Dec 18, 2009 03:43 AM
    Hi,

    How did you solve the problem with sorting categories?
    (We have not found a way to deleted Incidents yet).

    Thanks


  • 4.  RE: Sorting categories in Hierarchy Tree and deleting incidents

    Posted Dec 20, 2009 08:32 PM
    It's just a matter of editing. I added entries (and as expected, they were not sorted), then after I finished adding all the entries I wanted, I edited them from the beginning. With that, you will get all entries in order.

    As for deleting incidents, do you know how to do it with deleting entries in sql ensemble database?


  • 5.  RE: Sorting categories in Hierarchy Tree and deleting incidents

    Posted May 03, 2010 03:56 PM
    I'm not sure what you mean by "edited them from the beginning."  Do you mean you just opened each Hierarchy item from the admin portal and saved it again?  I'm trying this and it does not appear to sort anything.


  • 6.  RE: Sorting categories in Hierarchy Tree and deleting incidents

    Posted May 03, 2010 04:09 PM
    Please, everyone who browses this topic, subscribe to KB 50511 feature request to sort Hierarchy Items.  Here's a link:
    https://kb.altiris.com/display/1/kb/article.asp?aid=50511&n=1&s=

    I really can't believe they didn't think of this a long time ago.  Was any of ServiceDesk tested before they started selling it?  I'm starting to wonder.


  • 7.  RE: Sorting categories in Hierarchy Tree and deleting incidents

    Posted May 04, 2010 10:17 AM

    Oh, this is so much better than what I was planning on doing.  My SQL weak!!!  You SQL strong like Kung Fu.

    I got some errors on first run - there appear to be a couple of spaces missing.  When I used "Alter Table" instead of "AlterTable" and "Create Clustered" instead of "CreateClustered" then it ran fine.

    To others who read this thread and have weak SQL like me - Fabrice's query above creates a permanent sort index on the HierarchyItem table.  It doesn't matter if you run it before or after you create / edit your Hierarchy items.

    I'll give this post about 1 week before Symantec hides it like they did on your last awesome post with the SYMC.LoadHierarchyFromFile package.



  • 8.  RE: Sorting categories in Hierarchy Tree and deleting incidents

    Posted May 04, 2010 11:26 AM
    Hi All,

    The component that loads hierarchy items does simply not sort anything. Well, for performance it's a good idea to let the SQL engine classify data so that you do not have to add an order by to your query.
    The problem is that the hirearchy table is using a clustered index on the hierarchy ID instead of the hierarchy name.

    Please try the following query on your Servidesk database (Ensemble by default). Take care as it modifies the db index structure it may not be supported by Symantec.  We do that on all our Servidesk installations and it works fine.

    -- Start of script to change the Hierarchy index
    IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[HierarchyItem]') AND name = N'PK_HierarchyItemID')
    ALTER TABLE [dbo].[HierarchyItem] DROP CONSTRAINT [PK_HierarchyItemID]
     
    Go

    ALTER TABLE [dbo].[HierarchyItem] ADD  CONSTRAINT [PK_HierarchyItemID] PRIMARY KEY NONCLUSTERED
    (
          [HierarchyItemID] ASC
    )WITH(PAD_INDEX  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY]
     
    Go
     
    CREATE CLUSTERED INDEX [IX_HierarchyName] ON [dbo].[HierarchyItem]
    (
     [Name] ASC
    )WITH(PAD_INDEX  = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY]

    GO
    -- End of  script to change the Hirearchy index


    Enjoy!

    Fabrice

    Edit: Added some spaces - copy/paste concern. :)


  • 9.  RE: Sorting categories in Hierarchy Tree and deleting incidents

    Posted May 04, 2010 11:35 AM
    Hi Bmalt,

    Thanks for your comments.
    This work was a team work, I'm luckly not alone trying to find solutions.

    Thanks to Geoffroy Perrier from my company.

    Regarding the Load Hierearchy tool I developed, I will submit an article may be it'll stay longer and surely create an article for this sort issue solved also.

    Enjoy!


  • 10.  RE: Sorting categories in Hierarchy Tree and deleting incidents

    Posted May 04, 2010 12:09 PM

    Hey, one very minor suggestion on the "load hierarchy" tool before you re-post it.  I would default everything checked after you import the text file.

    I'm not sure the best way to accomplish this, but the following worked:

    Open the second Form Builder component
    Open the CheckBoxList component under the "Categories to load" header
    Edit "Selected Items" field to match the "Items" field - process variable "CategoriesToLoad"



  • 11.  RE: Sorting categories in Hierarchy Tree and deleting incidents

    Posted May 30, 2010 06:56 PM
      |   view attached

    Hi everyone,

    I've included a walkthrough with screenshots for anyone interested.  Please see attachments.

    Thanks again Fabrice B M Raud and Geoffroy Perrier from FABEMARA Consulting.

    Kevin Valente
    Valente Consulting
     



  • 12.  RE: Sorting categories in Hierarchy Tree and deleting incidents

    Posted Jun 03, 2010 11:53 AM

    Thanks for the process of sorting. I am going to try that out. 

    As for deleting tickets there is a feature request for that.  If you are interested in having that feature subscribe to this kb:

    https://kb.altiris.com/display/1n/articleDirect/index.asp?aid=51578&r=0.2790033