Document toolboxDocument toolbox

Job History SOAP API

On This Page:

Related Pages:

The sp:JobHistoryRequest API method can be used to obtain the details of a job's history.

Description

The sp:JobHistoryRequest API method allows the details of changes made to a given job over time to be obtained. The API offers a number of different options to filter the change details that are returned.

Definition

The definition of this API is:

 Click here to expand...

Web Service

Type

Description

Req?

Val?

<sp:JobHistoryRequest>

 

 

 

 

 

<jobId>?</jobId>

JobID

The identifier of the job for which the job history is required. The error SP_JOBID_INVALID (1) will be returned if the supplied JobID does not exist in the ServicePower database.

(tick)

(tick)

 <options>?</options>HistoryOptions

An optional field which can be used to restrict the type of changes returned.

When set to All:

  • As per HistoryOptions, system and manual history changes will be returned.
  • Any supplied filterUserList values in the API call will be ignored.
  • Results will be filtered by any supplied filterActionList values in the API call.

When set to Manual:

  • As per HistoryOptions, only manual history changes will be returned.
  • Results will be filtered by any supplied filterUserList values in the API call.
  • Results will be filtered by any supplied filterActionList values in the API call.

When set to System:

  • As per HistoryOptions, only system history changes will be returned.
  • Any supplied filterUserList values in the API call will be ignored.
  • Results will be filtered by any supplied filterActionList values in the API call.

When not supplied, the options field will use a default value of All - however, in this situation, the inclusion of any supplied filter options via the filterUserList and filterActionList structures will result in the SP_NO_OPTIONS_SET (807) error being returned.

  
 <filterUserList> 

An optional structure containing one or more filterUser values. When supplied (and not ignored, depending on the value supplied for the options parameter), the job history changes returned will be filtered to only those changes performed by the user(s) that match the value(s) supplied.

  
  <filterUser>?</filterUser>string(1-50)A string matching an entry from the SP088_USERS_UNITS table, representing a user.  
 </filterUserList>    
 <filterActionList> 

An optional structure containing one or more filterAction values. When supplied (and not ignored, depending on the value supplied for the options parameter), the job history changes returned will be filtered to only those changes that match the action value(s) supplied.

  • If any filterAction value supplied is invalid, then the SP_FILTER_ACTION_DOES_NOT_EXIST (805) error will be returned.
    • An invalid value means:
      • A value supplied does not match one of the valid values listed below;
      • The options field has been set to Manual, but a value supplied corresponds to a SP598_SYSTEM_ACTIONS table action; or
      • The options field has been set to System, but a value supplied corresponds to a SP501_GANTT_ACTIONS table action.
  • If any filterAction value is duplicated in the filterActionList, then the SP_FILTER_ACTION_DUPLICATE (806) error will be returned.
  • If the filterActionList structure is supplied but ignored, then the SP_OK_FILTERLIST_IGNORED (810) warning will be returned.
  
  <filterAction>?</filterAction>string(1-255)

A string matching an entry from either the SP501_GANTT_ACTIONS table or the SP598_SYSTEM_ACTIONS table, representing a type of change to the job (i.e. action).

Valid values are:

SP501_GANTT_ACTIONS Table ActionDescription

Call.Confirm

The job's confirmed state was changed.
FJ.AllocThe job was allocated via the ServiceGANTT "Find Job" function.
FJ.MoveThe job was moved via the ServiceGANTT "Move Job" function.
Job.AllocThe job was allocated.
Job.BookThe job was booked to the "intray".
Job.ChAccessThe job's Access Hours were changed.
Job.ChAttribThe job's attributes were changed.
Job.ChFixedThe job's Fixed Status was changed.
Job.ChStatusThe job's Dispatch Status was changed.
Job.DeallocThe job was Deallocated.
Job.MoveThe job was moved.
Job.ResizeThe job was resized.
Job.RestoreAHPThe job's Access Hours Pattern was restored.
SP598_SYSTEM_ACTIONS Table ActionDescription
act.moveThe job was moved.
BookApptThe job was booked from an external system.
BookApptExecuteThe job was booked from an external system.
BookDependencyGroupFromSlotsThe job was booked as a group of dependent jobs.
BookJobFromSlotThe job was booked as an SLA job from an external system.
BookJobFromSlotExecuteThe job was booked as an SLA job from an external system.
CancelApptThe job was cancelled from an external system.
CancelDependencyGroupThe job's dependency group was cancelled.
ChangeJobArrivalTimeThe job's Arrival Time was changed.
ChangeJobDateTimesThe job's Date Time was changed.
ChangeJobFinishTimeThe job's Finish Time was changed.
ChangeJobPriorityThe job's Priority was changed.
ChangeJobStartTimeThe job's Start Date was changed.
ChangeJobStatusThe job's Status was changed from an external system.
DBTidyThe job was changed by the DBTidy process.
DeleteJobThe job was deleted.
DeleteJobExecuteThe job was deleted.
FindNextJobThe system action recorded when the job was allocated via the ServiceGANTT "Find Job" function.
GetSlotForBookJobWithReassignThe job was moved to make space for an SLA job.
job.allocThe job was allocated.
job.bookThe job was booked to the "intray".
job.chaccessThe job's Access Hours were changed.
job.chapptThe job's Appointment Hours were changed.
job.chattribThe job's attributes were changed.
job.chstatusThe job's Dispatch Status was changed.
job.deallocThe job was Deallocated.
job.gnjexecuteThe system action recorded when the job was moved via the ServiceGANTT "Move Job" function.
job.restoreahpThe job's Access Hours Pattern was restored.
JobForceFixThe job was moved and fixed.
mainThe job was changed during FRU initialization tidy up.
OfferApptsWithReassignThe job was moved to make space for an appointment.
ru.overlapsThe job was moved to fix a schedule overlap issue.
SetJobClearedThe job was marked as cleared by an external system.
UpdateJobThe job details were changed by an external system.
  
 </filterActionList>    
</sp:JobHistoryRequest>    

Return Structure

The API returns a non-standard return structure.

 Click here to expand...

Web Service

Type                   

Description

Req?

Val?

<sp:JobHistoryResponse>

 

 

 

 

 

<result>

 A structure containing details of the success or failure of the API call.  
  <type>?</type>ReturnCodeTypeThe type of return code, indicating if the result is success, success with a warning, or failure.  
  <code>?</code>intThe Return Code number, representing the result of the API call.  
  <errNote>?</errNote>stringOptional note about any error(s).(error) 
 </result>    
 <auditStatus> 

A optional structure describing the level of job history auditing that is currently enabled in ServiceScheduling.

  • This structure is only returned when the API call does not return an error Return Code.
  
  <ganttAuditing>?</ganttAuditing>AuditStatusIndicates if job history auditing of changes made via ServiceGANTT is enabled or not enabled.  
  <systemAuditing>?</systemAuditing>AuditStatus Indicates if job history auditing of changes made via the API and/or ServiceOptimizer system is enabled, not enabled, or partially enabled.  
  <auditSetup> 

An optional structure, which may be returned multiple times, providing further details on the level of API and/or ServiceOptimizer system job history auditing, when this is only partially enabled.

  • This structure is only returned when the systemAuditing value above is PARTIAL.
  
   <auditName>?</auditName>string

The name of the relevant SP083_SYSTEM_PARAMETERS table entry that the auditUsage structure is providing details on. One of:

  • gantt_audit_trail
  • sp100_audit
  • sp108_audit
  • sp111_audit
  
   <auditStatusValue>?</auditStatusValue>AuditStatus Indicates if job history auditing via the relevant parameter defined by the auditName value in the auditUsage structure is enabled or not enabled.  
  </auditSetup>    
 </auditStatus>    
 <transaction> 

An optional structure, which may be returned multiple times, containing the details of the relevant job history records, given the API call input values.

  • This structure is only returned when the API call does not return an error Return Code.
  • This structure is only returned if there any relevant job history records to be returned.
  
  <timestamp>?</timestamp>timestamp

The date and time of the job history record. Times are in the time zone of the database server (SYSDATE) with no conversion applied.

  
  <sequence>?</sequence> A sequence number, where multiple records are recorded for the same transaction.  
  <transaction>?</transaction> The job history transaction number.  
  <action>?</action>string(1-20)

Either:

  • A string matching an entry from the SP501_GANTT_ACTIONS table, representing a type of change made by a user (i.e. see details in the description of the filterAction input field); or

  • A string matching an entry from the SP598_SYSTEMS_ACTIONS table, representing a change made by the ServiceOptimizer system.

  
  <user>?</user>string(1-50)The username of the user who performed the change to the job, if relevant.  
  <field> 

An optional structure, which may be returned multiple times, containing the details of fields changed as part of the overall change to the job being described in the transaction structure.

  • This structure is only returned if one or more field values were changed as part of the transaction.
  
   <name>?</name> The name of the job field that was changed as part of the transaction.  
   <old_value>?</old_value> The value of the field prior to the change.  
   <new_value>?</new_value> The new value of the field as set by the change performed.  
  </field>    
 </transaction>    
</sp:JobHistoryResponse>    

Return Codes

In addition to the Standard Return Codes, the possible Return Codes from this API are:

 Click here to expand...
  • SP_JOBID_INVALID (1)
  • SP_USERID_DOES_NOT_EXIST (703)
  • SP_FILTER_ACTION_DOES_NOT_EXIST (805)
  • SP_FILTER_ACTION_DUPLICATE (806)
  • SP_NO_OPTIONS_SET (807)
  • SP_USER_NOT_VALID (808)
  • SP_FILTER_USER_DUPLICATE (809)
  • SP_OK_FILTERLIST_IGNORED (810)