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

How "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. 

Where is this information populated from?

Environment

ITMS 8.5, 8.6

Resolution

Information for "Started By" column is the same as collected as "Executed By" from "tmSelectSummariesForTaskWithChildren" stored procedure:
EXECUTE tmSelectSummariesForTaskWithChildren @TaskGuid='{9f2d3891-fcd9-4260-9424-8671fef6dc67}'

This "tmSelectSummariesForTaskWithChildren" stored procedure gets its information this way:

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 expected one, you could execute stored procedure by passing the GUID for the task:

EXECUTE tmSelectSummariesForTaskWithChildren @TaskGuid='Affected Task GUID'

and compare what they will see from SQL output and in 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.

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