How the "Started By" column is populated after running a Job/Task
search cancel

How the "Started By" column is populated after running a Job/Task

book

Article ID: 257765

calendar_today

Updated On:

Products

IT Management Suite

Issue/Introduction

When you run a Job or Task, in the Task Status UI there is a "Started By" column showing a User that triggered the job or task as shown here:

Where is this information populated from?

Environment

ITMS 8.x

Resolution

Information for the "Started By" column is the same as that collected as "Executed By" from "tmSelectSummariesForTaskWithChildren" stored procedure:

EXECUTE tmSelectSummariesForTaskWithChildren @TaskGuid='{9f2d3891-fcd9-4260-9424-8671fef6dc67}'

This "tmSelectSummariesForTaskWithChildren" stored procedure gets its information from the following query:

USE [Symantec_CMDB]
GO
/****** Object:  StoredProcedure [dbo].[tmSelectSummariesForTaskWithChildren]    Script Date: 1/11/2023 5:18:09 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[tmSelectSummariesForTaskWithChildren]
                    @TaskGuid uniqueidentifier
                as
          declare @noActiveMaintWndGuid uniqueidentifier
          
          set @noActiveMaintWndGuid = 0x0
          
          
                    select ti.[TaskInstanceGuid][Name][ExecutedBy][StartTime][EndTime][InstanceStatus],
                        [ChildInstancesTotal][ChildInstancesSucceeded][ChildInstancesReplicated][ChildInstancesFailed],
                        [ChildInstancesStarted][ChildInstancesNotStarted], ti.[TaskVersionGuid],
                        case when [InstanceStatus] <> 1 then 0 else (    
                                                                        select sum (case when acs.MaintWnd is null                                                                                             
                                                                                            or acs.MaintWnd <> @noActiveMaintWndGuid then 0 
                                                                                         else 1 
                                                                                    end)
                                                                        from TaskInstancesIncomplete iti
                                                                            join TaskInstanceParents itip on iti.TaskInstanceGuid = itip.TaskInstanceGuid
                                                                            left join Inv_AeX_AC_Client_Status acs on iti.ResourceGuid = acs._ResourceGuid
                                                                        where itip.ParentTaskInstanceGuid = ti.TaskInstanceGuid
                                                                    ) end as [ChildInstancesNotInMW]
                        from [dbo].[TaskInstanceSummaries] ti
                            left outer join [dbo].[TaskInstanceResultSummaries] tir on tir.[TaskInstanceGuid] = ti.[TaskInstanceGuid]
                            left outer join [dbo].[TaskInstanceChildCountSummaries] tic on tic.[TaskInstanceGuid] = ti.[TaskInstanceGuid]
                        where ti.[TaskVersionGuid] in ( select [VersionGuid]
                            from [dbo].[ItemVersions]
                            where ItemGuid = @TaskGuid )

If you want to troubleshoot an issue where the User is a different one triggering the job or task than the one expected, you could execute the stored procedure by passing the GUID of the task:

EXECUTE tmSelectSummariesForTaskWithChildren @TaskGuid='Affected Task GUID'

and compare what is returned from SQL output and in also in the UI.

Note: You can usually find the GUID associated to an item by selecting the item>right-click>Properties and grab the GUID from the Properties UI that opens as seen here:

EXECUTE tmSelectSummariesForTaskWithChildren @TaskGuid='8ca1dd7d-07b6-4163-b04c-87d4b47cd3fe'