Menu

Stop TTR timer in waiting _for_ approval state

3 days ago
1 day ago
  • João Felipe Miranda Bonifácio

    We're having a problem with the TTR and TTO stopping counting when the ticket is in the waiting_for_approval state. We've tried several ways and we're stuck with the source of the extension.

    No error is returned, but the TTR continues to count in the waiting_for_approval state.

    <class id="UserRequest" _delta="must_exist">
      <fields>
        <field id="cumulatedpending" xsi:type="AttributeStopWatch" _delta="redefine">
          <states>
            <state id="pending"/>
            <state id="waiting_for_approval"/>
          </states>
          <working_time/>
          <thresholds/>
          <goal/>
        </field>
        <field id="tto" xsi:type="AttributeStopWatch" _delta="redefine">
          <always_load_in_tables>true</always_load_in_tables>
          <states _delta="redefine">
            <state id="new" />
            <state id="escalated_tto" />
            <state id="approved" />
          </states>
          <working_time />
          <goal>ResponseTicketTTO</goal>
          <thresholds>
            <threshold id="75">
              <highlight>
                <code>warning</code>
                <persistent>false</persistent>
              </highlight>
              <actions>
              </actions>
            </threshold>
            <threshold id="100">
              <highlight>
                <code>critical</code>
                <persistent>false</persistent>
              </highlight>
              <actions>
                <action>
                  <verb>ApplyStimulus</verb>
                  <params>
                    <param>ev_timeout</param>
                  </params>
                </action>
              </actions>
            </threshold>
          </thresholds>
        </field>
        <field id="ttr" xsi:type="AttributeStopWatch" _delta="redefine">
          <always_load_in_tables>true</always_load_in_tables>
          <states _delta="redefine">
            <state id="new" />
            <state id="escalated_tto" />
            <state id="assigned" />
            <state id="approved" />
            <state id="escalated_ttr" />
          </states>
          <working_time />
          <goal>ResponseTicketTTR</goal>
          <thresholds>
            <threshold id="75">
              <highlight>
                <code>warning</code>
                <persistent>false</persistent>
              </highlight>
              <actions>
              </actions>
            </threshold>
            <threshold id="100">
              <highlight>
                <code>critical</code>
                <persistent>false</persistent>
              </highlight>
              <actions>
                <action>
                  <verb>ApplyStimulus</verb>
                  <params>
                    <param>ev_timeout</param>
                  </params>
                </action>
              </actions>
            </threshold>
          </thresholds>
        </field>
      </fields>
    </class>
    

    I appreciate the help!

     
  • Vincent @ Combodo

    I am a little puzzled with your description, from the redefinition you've made just above, it's very clear that TTR and TTO will stop counting when the ticket is in the waiting_for_approval state.
    If this is not what you want remember that the "states" for a Stopwatch correspond to the full list of states in which time will be running, so will be counted.
    By the way there is no reason to have 2 "redefine" within the same branch of XML, if you only want to change the states, then use a delta="must_exists" or none at the stopwatch field level.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.