Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to pull Logged Hours (Time Spent) into custom field then multiply it by 2.10 for every hour

Eric Myers
April 28, 2022

Hello,

I've been researching how we can pull Logged hours (Time Spent) from Time Tracking into a scripted custom field that would then calculate the hours multiplying by 2.10 to display a new total for the SDA Hours custom field.

Reason: We have two different billable price ranges based on hours spent so every hour logged in the Jira ticket for our Project workflow is worth 2.10 hours in SDA Hours

i.e.:

Logged Hours  = 1

SDA Hours = 2.10

I've tried different options from here and other sources and managed to display the Logged hours in the custom field but not calculated. Every article I read was for calculating multiple fields into one custom field whereas here we're just trying to pull data and calculate it into a field that is really just displaying the total calculated result.

Basic script I'm working off for our SDA Hours custom field-

def timeSpent = issue.getTimeSpent();
if (timeSpent == null) {
return null;
}
return timeSpent;

So the question is this even possible? And if so, how would I go about scripting this?

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Meg Holbrook
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
May 3, 2018

Hey Sergio, 

Sounds like an interesting use case to keep all child tickets organized. Hope someone can assist you!

TAGS
AUG Leaders

Atlassian Community Events