排除非工作时间将工作时段引入账号

决条件:您必须熟悉教程中使用的语法 并且已经创建了一个扩展.

学习:显示在工单上花费的时间

水平:初学者

域:XMLStopwatch

最低版本:2.1.0

在此教程中,我们假设您正在使用账号工作时段来计算TTO和TTR基于工作时段的SLA 扩展,您想显示在​​TTR中花费的时间,但忽略非工作时间。

在秒表中,我们有4个内部子项目:

代码标签含义

timespent

Elapsed

在与秒表相关的状态下花费的总时间-如果秒表正在运行,则不准确!
startedstarted秒表第一次启动时
LaststartLastStart当秒表最后一次启动时-如果秒表已停止,则为空
stoppedstopped秒表最后一次停止的时间-如果秒表正在运行,则为空

排除非工作时间将为您提供这两个内部之间的时间:ttr_started和ttr_stopped。但这可能不是您想要的,因为此延迟是这两个事件之间的总时间。账号并没有考虑到TTR在此期间已停止的事实,它忽略了工作时段。

如果您想要的是支持团队到解决和工单花费的实时时间,请使用耗时的SubItem。为此,您必须在XML中将其声明为UserRequest类的字段。

itop_design / classes / class@UserRequest
 
   <fields>
     <field id="tto_timespent" xsi:type="AttributeSubItem" _delta="define">
     <target_attcode>tto</target_attcode>
     <item_code>timespent</item_code>
     </field>
    </fields>

子项目必须在XML中明确声明为字段,才能在OQL中使用并显示在屏幕上。

您可以在UserRequest的详细信息屏幕中显示它,也可以不显示它,无论如何它都可以在“自定义此列表”视图中,小表格和OQL查询中使用。

这是一个耗时显示与秒表显示的示例:

https://www.itophub.io/wiki/media?media=2_7_0%3Acustomization%3Alifecycle-stopwatch-timespent-cut.png

  • 秒表已多次启动和停止,因此,“经过”与“已启动”和“已停止”之间的差异不符
  • 7 * 60s + 49s = 469s:提供者花费的时间只是“经过”子项的漂亮展示
  • 这是此教程的摘录:标记等待第三次聚会的工单 

原贴链接:https://www.itophub.io/wiki/page?id=2_7_0%3Acustomization%3Aadd-subitems


Resolution delay taking Coverage window into account

Prerequisite: You must be familiar with the Syntax used in Tutorials and have already created an extension.

learning:
Display time spent on Ticket
level:
Beginner
domains:
XMLStopwatch
min version:
2.1.0

In this tutorial, we suppose that you are calculating TTO and TTR taking into account Coverage Window, using SLA considering business hours extension, and you want to display the time spent let say in TTR, but ignoring the non-working periods.

Within a stopwatch we have 4 internal sub-items:

CodeLabelMeaning
timespentElapsedtotal time spent within the states associated with the stopwatch - not accurate if stopwatch is running!
startedStartedwhen the stopwatch has started for the first time
laststartLastStartwhen the stopwatch has started for the last time - empty if stopwatch is stopped
stoppedStoppedwhen the stopwatch was stopped for the last time - empty if stopwatch is running

Resolution delay will give you the time between those two internals: ttr_started and ttr_stopped. But that may not be what you want as this delay is the total time between those two events. It does not take into account the fact that maybe the TTR was stopped during that period, and it ignores coverage window.

If what you want is the real time spent by your support team to resolve a ticket then use the timespent SubItem. For this you must declare it in XML as a field of the UserRequest class

itop_design / classes / class@UserRequest
 
   <fields>
     <field id="tto_timespent" xsi:type="AttributeSubItem" _delta="define">
     <target_attcode>tto</target_attcode>
     <item_code>timespent</item_code>
     </field>
    </fields>

Sub-items must be explicitly declared in XML as field to be usable in OQL and displayed in screen.

You may display it or not in the details screen of a UserRequest, it will anyway be available in “Customize this list” view, in dashlets and OQL queries.

Here is an example of a timespent display versus stopwatch display:

https://www.itophub.io/wiki/media?media=2_7_0%3Acustomization%3Alifecycle-stopwatch-timespent-cut.png

  • The stopwatch was started and stopped multiple times, as a result, “Elapsed” does not correspond to the difference between “Started” and “Stopped”

  • 7*60s + 49s = 469s: Provider time spent is just a nice display of the “Elapsed” sub-item

  • It's an extract from this tutorial: Flag Tickets waiting for a 3rd party

标签:
由 superadmin 在 2020/08/27, 17:27 创建
    

需要帮助?

如果您需要有关XWiki的帮助,可以联系:

深圳市艾拓先锋企业管理咨询有限公司