Required user to update Spent time on state change

 I am trying to require users to update Spent Time when changing state to 'Coded', 'Verified', or 'Documented'. I do see that you can set a field required, and also see that there is an assert function; however, it does not seem to do what I want:

rule Must update time spent when mark Coded

when State.becomes({Coded}) {
assert !(Spent Time.changed): "Please update your time spent";
}

Am I missing something here regarding Spent Time.changed? It does not seem to change value as you go through the workflow. I tried modifying the Spent time and then changing to 'Coded'- Spent Time.changed evaluated to true. Then marked my issue reopened and back to Coded without adding Spent Time- Spent Time.changed still evaluated as true. 

When can I expect this value to be false? This is for a Stateless rule in a Workflow.

3 comments
Comment actions Permalink

Hi! "Spent time" field can't be updated manually, for these purposes you should use "Estimation" field. 

0
Comment actions Permalink

Hi Liubov,
To your first point- I suppose what I meant was that I want to require people to add their work items. I was hoping to use Spent time to detect whether this has been done from session to session. Ideally, we would use Work Items and determine whether those have been update but they are not visible to the workflow. Spent Time is the next best thing. The expected behavior is- when switching State to 'Coded', Verified, or Documented:

1) Has Spent Time been updated since last transition changed to one of the states above?
2a) If no- notify the user that they need to add Work Items (and hence increase their spent time)
2b) If yes, do nothing- allow them to transition without notice

To your second point- Estimation is currently being used for actual time Estimation rather than tracking time worked- so it is already used for something else. 

0
Comment actions Permalink

Please try to change assert to: assert Spent time.changed: "notification" , notification will be shown, if the condition is not fulfilled, 

0

Please sign in to leave a comment.