Columbus Endpoint Management User Group

 View Only
  • 1.  Need SQL to list all Tasks that are part of a Job

    Posted Dec 12, 2013 02:41 PM

    In the DS 6.x days, I had a SQL that would list all of the parts of a Job.  I need to have something like that in v7.x.  Does anyone already have something like this written?  I basically want to pass a job name/guid to the SQL and have it list all of the jobs/tasks that are part of the job in the order that they appear in the GUI.  I can write it myself if I knew how/where the data was stored.

     

    Thanks,

    Jason



  • 2.  RE: Need SQL to list all Tasks that are part of a Job

    Posted Dec 13, 2013 04:40 AM

    Hi jasoncordell

    For your purposes I can suggest to use the ItemReference SQL table. That table contains all items references. Example of simple query that displays the list of tasks are used by certain job:

    Select * from ItemReference Where ParentItemGuid='JobsGUID' and Hint='jobusestask'

    "ChildItemGuid" column contains GUID's of all used tasks.

    For displaying tasks names instead of GUIDs, just make a join to Item SQL table, where are located all NS item names.

    Good Luck

    Anton N.

     

     

     



  • 3.  RE: Need SQL to list all Tasks that are part of a Job

    Broadcom Employee
    Posted Dec 13, 2013 04:54 AM

    Hi Jason,

    Client or Server Job with list of reference of part tasks can be found in dbo.ItemReference table

    Name of Job and all associated tasks in can be found in dbo.Item table

     

    Thanks,

    IP.



  • 4.  RE: Need SQL to list all Tasks that are part of a Job

    Posted Dec 17, 2013 08:24 AM

    SELECT i1.Name AS Job,i1.[Description] AS [Job Description],
    i2.Name AS Task,i2.[Description] AS [Task Description]
    FROM Item i1
    JOIN ItemReference ir ON ir.ParentItemGuid = i1.[Guid]
    JOIN Item i2 ON i2.[Guid] = ir.ChildItemGuid
    WHERE ir.Hint = 'jobusestask'
    ORDER BY i1.Name,i2.Name ASC



  • 5.  RE: Need SQL to list all Tasks that are part of a Job

    Posted Dec 28, 2013 05:54 AM

    Please mark as resolved if you no longer require assistance.



  • 6.  RE: Need SQL to list all Tasks that are part of a Job

    Broadcom Employee
    Posted Dec 28, 2013 06:24 AM

    SK, if you will say this for everyone in all forum threads, then we all can get updated state of all threads :)



  • 7.  RE: Need SQL to list all Tasks that are part of a Job

    Posted Dec 28, 2013 06:35 AM

    If a thread is marked as resolved, then Forum contributors will not have to review threads that appear to be in a resolved state, and can concentrate on answering threads that still do need help.