Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira Automation: Convert Time Tracking into number in custom field, add validator time and divide

Using: Jira Software Cloud Version

 

Current Scenario: We track time spent in development (Time Tracking) and time spent validating/testing (Validator Time). We use the "Time tracking" issue field and a custom "Validator Time" number field. The team knows that the "Validator Time" must be entered in a specific format (e.g.: (1, 1.25, 1.5, 1.75, 2, etc.)

 

Current Need: We want to add the Time Tracking + Validator Time and then convert it into Story Point by dividing by 4. (4hrs = 1 Story Point)

 

Performed: Created an automation Rule that when issues are transitioned from "In Progress" to "Done" it set the Time Tracking to 0, then the custom field Tracking Time pulls Time Tracking and divides by 3600 and stores it. Then it Validates that the "Validator Time" is Greater than zero and "Tracking Time" is great than zero. Finally, if both previous conditions are true it pulls the "Tracking Time" divides by 4 and adds "Validator Time divided by 4".

 

Problem: When I move an issue from "In Progress" to "Done" and "Time Tracking" has minutes e.g.: (15m, 30m, 45m, 1h 15m, 1h 30m, 1h 45m, etc.) The Tracking Time result is zero when it should be 0.25, 0.5, 0.75, 1.25, 1.5, 1.75)

 

Below: The formulas and transitions

1. Issue transitioned:

In Progress to Done

2. Edit Issue:

Tracking Time: {{issue.field|0}}

3. Edit Issue:

Tracking Time: {{issue.timetracking.timeSpentSeconds.divide(3600)}}

4. Branch Rule/Related issues:

Type: Current issue, Restricted: Playground project

5. Issue Field condition:

Validator Time greater than 0

6. Issue Field condition:

Tracking Time greater than 0

7. Edit issue:

Actual Points: {{#=}}{{issue.Tracking Time.divide(4).round}}+{{issue.Validator Time.divide(4).round}}{{/}}

 

Note: I'm new to Jira automation.

 

Help needed: How can I get this to convert time tracking add it against validator time and divide the total by 4 to get Actual Story Points.

1 answer

1 accepted

0 votes
Answer accepted

Hi @javier_espinosa 

I am unclear why you are trying to calculate story points, usually an abstract relative measure, with a formula. Why not just talk to the team about using time-based estimation?  Regardless of that question...

It appears you are updating your Tracking Time custom field within the rule and then trying to use the new value in the same rule later.  When you want to do that, you need to add an action for Re-fetch to load new values from storage.  Please note this will slow down your rule significantly.

Best regards,

Bill

Thank you Bill for taking the time to respond to my question.


We estimate in Story Points and wanted to get Actual Story Points from the actual time spent (both Time Tracking + Validator Time). Thus having both Estimated Story Points and Actual Story Points. This would allow observing the variance of the issue between the Estimate and Actuals.

I made this short 10min video where I share my screen and and walk thru my situation. I would appreciate if you could check this out and advise.


https://www.awesomescreenshot.com/video/3217486?key=d228897843853f94a4d98e6c6c2a04c6



Also inserted a screenshot of the rule. I not sure how to add a re-fetch of the new value and where to place it in the rule.

 

Screen Shot 2021-03-30 at 9.42.48 AM.png

 

Cheers,

Javier

Hi @javier_espinosa 

Thanks for the image of the rule; that helps quite a bit when trying to diagnose automation symptoms.  Let me try to explain about my Re-fetch suggestion:

  • When an automation rule triggers, the data in any issues used is up to date at the point it time they are gathered
  • My understanding is: If the rule edits the issue, the edits are saved to storage...However, they do not yet impact the values the rule knows about in memory.  Those are still the values from the original load.
  • If you want the changed fields to be accessible to the rule, the issue needs to be Re-fetched from storage

In your rule, you edit Tracking Time twice and then use it to edit the New Actual Points.  I suggest that:

  • You consider if you can edit Tracking Time with one edit, and then add a Re-fetch action after that edit
  • If you cannot combine the two edits of Tracking Time, you would need to add a Re-fetch action after each edit 

Bill,

 

Thank you very much for your support and for explaining how to use the re-fetch function/action.

I made significant changes and combined with the re-fetch it works great. Explaining what I did incase someone else wants to do this.

Goal: Be able to compare Estimated Story Points with Actual Story Points.

Created following custom fields and its purpose:

Time Tracking Conversion: Pull Time tracking and store it in seconds

Tracking Time: Pull TimeTracking Conversion and store it in hours

Validator Time: Number field for the tester to enter their time spent in testing/validation

New Actual Points: divide by 4 to convert hours into story points.

Actual Story Points: use .ceil to round up.

Story Point Variance: subtracts Story Points minus Actual Story Points

 

Note: re-fetch action makes this rule work.

 

Automation formulas used:

{{issue.timetracking.timeSpentSeconds}}

{{#=}}{{TimeTracking Conversion}}*0.0002778{{/}}

{{#=}}{{issue.Tracking Time.divide(4)}}+{{issue.Validator Time.divide(4)}}{{/}}

{{issue.New Actual Points.ceil}}

 

 

Below an image of the Automation rule.

Screen Shot 2021-03-31 at 6.30.25 PM.pngScreen Shot 2021-03-31 at 6.31.01 PM.png

 

Thank you very much Bill for your advice. I hope for someday to be great in Jira as you to be able to help you and return the favor. Thanks

 

Cheers

Javier Espinosa

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Automation

Announcing the Jira automation template library!

Hi all,  After many months of work, I am delighted to announce the launch of the Jira Automation Template Library!  The Template Library is a new website dedicated to all things Jira au...

973 views 17 24
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you