How to update the TimeSpent of a ticket using the TimeSpent recorded each time on another ticket

Nawaaz SOHAWON March 16, 2021

Hi All,

My issue is as follows:

I have a custom request type called Project Details where I input the "Hours Sold" for support in the OriginalEstimate field.

Each time an incident or a service request ticket is created, it is automatically linked to the Project Details ticket.

I have created an automation which add the "TimeSpent" from the incident/service request to the WorkLog of the Project Details. This is being done to know how many hours are left in the "Hours Sold" contract.

The automation use the following field editing:

{{#debug}}
{
"update": {
"worklog" : [
{
"add": {
"timeSpent" : "{{triggerissue.worklog.timeSpent}}"
}
}
]
}
}
}
{{/}}

(The debug is there for testing purposes)

However this is incorrect because it is sending over the total TimeSpent to the "Project Details" ticket each time and I want to send only the time being input each time.

For ex:

Total Hours Sold: 4h (value in OriginalEstimate for Project Details tickets)

1. Hours worked on incident/service request ticket: 1h

Hours remaining in Project Details; 3h

2. Hours worked on SAME incident/service request ticket: 30min

Hours remaining in Project Details: 2h30min

As of now The TimeSpent being sent over to the Project Details when I worked on the incident/service request ticket again is  2h 30min (1h + 1h30min) when only 1h30min should be deducted.

Hence why I need to send ONLY the TIME SPENT being input each time. Is there a specific field which stores this value?

Any help would be greatly appreciated and you would be known as The Ultimate JIRA Expert to me :)

Regards,

Nawaaz

1 answer

1 accepted

0 votes
Answer accepted
Nawaaz SOHAWON April 21, 2021

No ULTIMATE JIRA Expert as yet :))

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events