Skip to main content

WorkOrder function

getAvgResolutionTime#

The getAvgResolutionTime function takes the count, startTime and endTime(in millis) as input and returns list containing average Resolution Time By Category.

Syntax:

new NameSpace("workorder").getAvgResolutionTime(Number count,Number startTime,Number endTime);

Returns: List

Example:

response = new NameSpace("workorder").getAvgResolutionTime(count,startTime,endTime);log response;

getWorkOrdersByCompletionTime#

The getWorkOrdersByCompletionTime function takes the count, startTime and endTime(in millis) as input and returns list containing the workorder completion time of sites.

Syntax:

new NameSpace("workorder").getWorkOrdersByCompletionTime(Number count,Number startTime,Number endTime);

Returns: List

Example:

response = new NameSpace("workorder").getWorkOrdersByCompletionTime(count,startTime,endTime);log response;

getTopNTechnicians#

The getTopNTechnicians function takes the count, startTime and endTime(in millis) as input and returns list containing the technicians completed workorder high workorders.

Syntax:

new NameSpace("workorder").getTopNTechnicians(Number count,Number startTime,Number endTime);

Returns: List

Example:

response = new NameSpace("workorder").getTopNTechnicians(count,startTime,endTime);log response;

getTopNBuildingsWithPlannedTypeCount#

The getTopNBuildingsWithPlannedTypeCount function takes the count, startTime,endTime(in millis)and siteId as input and returns list containing the count of buildings with plan.

Syntax:

new NameSpace("workorder").getTopNBuildingsWithPlannedTypeCount(Number count,Number startTime,Number endTime,Number siteId);

Returns: List

Example:

response = new NameSpace("workorder").getTopNBuildingsWithPlannedTypeCount(count,startTime,endTime,siteId);log response;

getTopNTeamsWithOpenCloseCount#

The getTopNTeamsWithOpenCloseCount function takes the count, startTime,endTime(in millis)and siteId as input and returns list containing the teams with highest open and closed workorder count.

Syntax:

new NameSpace("workorder").getTopNTeamsWithOpenCloseCount(Number count,Number startTime,Number endTime,Number siteId);

Returns: List

Example:

response = new NameSpace("workorder").getTopNTeamsWithOpenCloseCount(count,startTime,endTime,siteId);log response;

getTopNTechWithAvgResolutionTime#

The getTopNTechWithAvgResolutionTime function takes the count, startTime,endTime(in millis)and siteId as input and returns list containing the technicians average resolution time which refers to the technician taken time for completing many workorder which is averaged and returned.

Syntax:

new NameSpace("workorder").getTopNTechWithAvgResolutionTime(Number count,Number startTime,Number endTime,Number siteId);

Returns: List

Example:

response = new NameSpace("workorder").getTopNTechWithAvgResolutionTime(count,startTime,endTime,siteId);log response;

getTopNBuildingsWithUnPlannedTypeCount#

The getTopNBuildingsWithUnPlannedTypeCount function takes the count, startTime,endTime(in millis)and siteId as input and returns list containing the count of unplanned buildings.

Syntax:

new NameSpace("workorder").getTopNBuildingsWithUnPlannedTypeCount(Number count,Number startTime,Number endTime,Number siteId);

Returns: List

Example:

response = new NameSpace("workorder").getTopNBuildingsWithUnPlannedTypeCount(count,startTime,endTime,siteId);log response;

getTopNTechWithOpenCloseCount#

The getTopNTechWithOpenCloseCount function takes the count, startTime,endTime(in millis)and siteId as input and returns list containing the technicians with open and closed workorder count.

Syntax:

new NameSpace("workorder").getTopNTechWithOpenCloseCount(Number count,Number startTime,Number endTime,Number siteId);

Returns: List

Example:

response = new NameSpace("workorder").getTopNTechWithOpenCloseCount(count,startTime,endTime,siteId);log response;

getTopNBuildingsPlannedClosedTotalWoCount#

The getTopNBuildingsPlannedClosedTotalWoCount function takes the count, startTime,endTime(in millis)and siteId as input and returns list of closed palnned buildings total workorder count.

Syntax:

new NameSpace("workorder").getTopNBuildingsPlannedClosedTotalWoCount(Number count,Number startTime,Number endTime,Number siteId);

Returns: List

Example:

response = new NameSpace("workorder").getTopNBuildingsPlannedClosedTotalWoCount(count,startTime,endTime,siteId);log response;

getTopNBuildingsWithRecurringUnPlannedCountForResource#

The getTopNBuildingsWithRecurringUnPlannedCountForResource function takes the startTime,endTime(in millis)and siteId as input and returns list containing the buildings with unplanned count because of resource.

Syntax:

new NameSpace("workorder").getTopNBuildingsWithRecurringUnPlannedCountForResource(Number startTime,Number endTime,Number siteId);

Returns: List

Example:

response = new NameSpace("workorder").getTopNBuildingsWithRecurringUnPlannedCountForResource(startTime,endTime,siteId);log response;

getTopNBuildingsWithUnPlannedCountForCategories#

The getTopNBuildingsWithUnPlannedCountForCategories function takes the count,startTime,endTime(in millis)and siteId as input and returns list containing the buildings with unplanned count because of category.

Syntax:

new NameSpace("workorder").getTopNBuildingsWithUnPlannedCountForCategories(Number count,Number startTime,Number endTime,Number siteId);

Returns: List

Example:

response = new NameSpace("workorder").getTopNBuildingsWithUnPlannedCountForCategories(count,startTime,endTime,siteId);log response;

getSiteName#

The getSiteName function takes the siteId as input and returns the site name.

Syntax:

new NameSpace("workorder").getSiteName(Number siteId);

Returns: String

Example:

siteId = 1370466;sitename = new NameSpace("workorder").getSiteName(siteId);log sitename;

addTaskSection#

The addTaskSection function takes the sectionName,parentTicket and sequenceNumber as input and returns the added task section Id.

Syntax:

new NameSpace("workorder").addTaskSection(String sectionName,Number parentTicket, Number sequenceNumber);

Returns: Long

Example:

taskSectionName = "<some task section name>";parentWo = "<some parentworkorder id>";seqNum = "<some sequence number>";log new NameSpace("workorder").addTaskSection(taskSectionName,parentWo,seqNum);