Time tracking of submitting issues Follow
We try to measure also time spent on submitting issues, because sometimes analytics spend a lot of time creating issues. So we created WF like this:
And another rule:
And now, what is going wrong? When I start to write new issue, Timer time is started. It's OK. When a submit it, second rule is triggered and total time is counted. OK. But no Time tracking line is added to this issue. And what is much worse, when I start to create another issue, total creating time from first issue is set as "Spent time" in newly created issue. No Time tracking lines are there, but Spent time is set. And there is no way how to reset it.
What is wrong? Where is problem? It is a feature of YT that is unable to time track issues until submitted?
Thx.
rule New issue writing when isReported() == false && Timer time == null { Timer time = now; }
And another rule:
rule New issue submitting when becomesReported() && Timer time!=null { var duration = now - Timer time; var seconds = (duration.millis-duration.millis%1000)/1000; var minutes = (seconds-seconds%60)/60; var hours = (minutes-minutes%60)/60; var days = (hours-hours%24)/24; minutes = minutes%60; hours = hours%24; if(days!=0){ message("Issue creating time"+days+"day(s)"+hours+"hour(s)"+minutes+"minute(s)."); } else if(hours!=0){ message("Issue creating time"+hours+"hour(s)"+minutes+"minute(s)."); } else if(minutes>0){ message("Issue creating time"+minutes+"minute(s)."); } if(seconds >= 60) { issue.applyCommand("add work Documentation Today"+days+"d"+hours+"h"+minutes+"m Work item added by trigger"); } }
And now, what is going wrong? When I start to write new issue, Timer time is started. It's OK. When a submit it, second rule is triggered and total time is counted. OK. But no Time tracking line is added to this issue. And what is much worse, when I start to create another issue, total creating time from first issue is set as "Spent time" in newly created issue. No Time tracking lines are there, but Spent time is set. And there is no way how to reset it.
What is wrong? Where is problem? It is a feature of YT that is unable to time track issues until submitted?
Thx.
Please sign in to leave a comment.
Probably you create a subtask? If so Spent Time is inherited from the parent task to the subtask.
And no, it is not any subtask. Try to reproduce this behaviour. Both (first issue, second issue) are simple tasks, without any subtask, without any child issues. Every minute "add work" is couted into "Spent time" of second issue.
It is really strange behaviour. I guess it must be some bug in YT.
Please clarify - do you mean this workflow works itself but applyCommand? I don't see any field assignment to set Spent time. If the applyCommand isn't applied who else can set Spent Time?
Let's go to simulate it. Try to create this VERY SIMPLE workflow with two Stateless rules:
Then assing it to any project.
When You start to write a new issue, Timer time is written down. It works well.
When You submit new issue, second rule is started. It is still OK.
I made it as simple as possible. No counting of time, just add 7 minutes as work.
When triggered, it add new comment "add work Today 0d0h7m Timer test".
But it doesn't add any Time tracking record. Try it, please, You will see.
Then try to create another new issue.
When form with new issue appears, You can see,that there is Spent time 7m.
Absolutelly new issue and 7 minutes Spent time? Why?
There are no records in Time tracing tab, no way how to delete this 7 minutes.
No, they are not any subtask, nothing like that.
Please just test it and You will see what I am talking about.