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?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events