IT Management Suite

Expand all | Collapse all

Finding GUID of task in DB

  • 1.  Finding GUID of task in DB

    Posted 10-21-2020 12:17 PM
    Hi Experts,
    We would like to find the location the SQL DB of a generated task that we ran. (this is in order to view task result in the DB, and not in the ITMS NS console):

    Where in the DB can we find this?

    thanks,

    Hagai


  • 2.  RE: Finding GUID of task in DB

    Broadcom Employee
    Posted 10-23-2020 08:52 AM
    Hi Hagai Nachmani!

    You can use resolved SQL query of default "Job/Task Status Detail" report and use it in opened SQL Management studio for required ITMS database
    (Just clone default system report, go to edit mode and check "Resolved Query" tab, then this resolved query with required parameters can be used from SQL management studio)


    --DECLARE @Status int
    DECLARE @lastNDays int
    DECLARE @guidFilterCollection uniqueidentifier
    DECLARE @guidTaskInstance uniqueidentifier
    DECLARE @strTaskName nvarchar(1024)
    DECLARE @strTaskInstanceName nvarchar(1024)

    --SET @Status = CAST('-1' AS int)
    SET @lastNDays = CAST('-1' AS INT)
    SET @guidFilterCollection = CASE 'eb3a1a12-e1c7-4431-b060-f0333e4e488c'
    WHEN '%' THEN NULL
    ELSE CAST('eb3a1a12-e1c7-4431-b060-f0333e4e488c' AS uniqueidentifier) END
    SET @guidTaskInstance = CASE '%'
    WHEN '%' THEN NULL
    ELSE CAST('%' AS uniqueidentifier) END
    SET @strTaskName = CASE '%'
    WHEN '%' THEN NULL
    WHEN '' THEN NULL
    ELSE '%' END
    SET @strTaskInstanceName = CASE '%'
    WHEN '%' THEN NULL
    WHEN '' THEN NULL
    ELSE '%' END

    EXEC[dbo].[Reports_tmTaskStatusDetail]
    @FilterCollectionGuid = @guidFilterCollection,
    @TaskInstanceGuid = @guidTaskInstance,
    @TaskInstanceName = @strTaskInstanceName,
    @TaskName = @strTaskName,
    @Status = -1,
    @LastNDays = @lastNDays,
    @Trustees = N'{2E1F478A-4986-4223-9D1E-B5920A63AB41},{582029E2-FC5B-4717-8808-B80D6EF0FD67},{84DFAA6B-7528-45BE-9D78-A43E918C2A5B},{B760E9A9-E4DB-404C-A93F-AEA51754AA4F}',
    @Culture = 'en-US'



    To see details of appropriate "Task Instance" of required "Job" or "Task", you can use this resolved query also from default "Client Task Status Details" report

    DECLARE @lastNDays int
    DECLARE @guidFilterCollection uniqueidentifier
    DECLARE @guidTaskInstance uniqueidentifier

    SET @lastNDays = CAST('-1' AS INT)
    SET @guidFilterCollection = CASE 'eb3a1a12-e1c7-4431-b060-f0333e4e488c'
    WHEN '%' THEN NULL
    ELSE CAST('eb3a1a12-e1c7-4431-b060-f0333e4e488c' AS uniqueidentifier) END
    SET @guidTaskInstance = CAST('put here your task instance GUID' AS uniqueidentifier)

    EXEC[dbo].[Reports_tmChildTaskStatusDetail]
    @FilterCollectionGuid = @guidFilterCollection,
    @ParentTaskInstanceGuid = @guidTaskInstance,
    @TaskInstanceName = N'Specify task instance name or leave empty',
    @TaskName = N'Specify task name or leave empty',
    @Status = -1,
    @LastNDays = @lastNDays,
    @Trustees = N'{2E1F478A-4986-4223-9D1E-B5920A63AB41},{582029E2-FC5B-4717-8808-B80D6EF0FD67},{84DFAA6B-7528-45BE-9D78-A43E918C2A5B},{B760E9A9-E4DB-404C-A93F-AEA51754AA4F}',
    @Culture = 'en-US'


    Thanks,
    IP.

    ------------------------------
    Software QA Engineer
    Broadcom Inc.
    ------------------------------



  • 3.  RE: Finding GUID of task in DB

    Posted 10-25-2020 03:27 AM
    Hi Igor, thank you for the elaborated reply, this will be very helpful to us! :)

    Thanks,

    Hagai.