Jira automation web request, calculate hours for each issue

Pasi Pönkkö
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 7, 2025

I get webresponse which returns all the issues under parent issue. I need to calculate and update each issues hours to field "reported hours". The problem is that my update issue field event calculates sum of each issue which starts with the same number. For example if I have issues like P1234-1 and P1234-11 I get the sum of these issues but what I actually want is that every ticket gets only the hours for exact match. 

Here I have an example and what I want is that P1234-1 gets 4 hours and P1234-11 gets 2 hours.

What I get now is 6 hour for issue P1234-2.

 

 {
        "personId": "12345",
        "timeEntry": {
            "description": "P1234-1: Doing something",
        },
        "time": {
            "date": "2024-12-09T00:00:00.000",
            "hours": 1
        }
    },

 

 {
        "personId": "12345",
        "timeEntry": {
            "description": "P1234-11: Doing something else",
        },
        "time": {
            "date": "2024-11-09T00:00:00.000",
            "hours": 2
        }
    },

 

 {
        "personId": "12345",
        "timeEntry": {
            "description": "P1234-1: Doing something",
        },
        "time": {
            "date": "2024-10-09T00:00:00.000",
            "hours": 3
        }
    },

1 answer

0 votes
Vishal Biyani
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 Leaders.
February 7, 2025

@Pasi Pönkkö 

can you share screen shot of the automation developed so far?

Also, share the end point url that you are using

Once we know the details then community will be able to help address your use case better.

Pasi Pönkkö
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 7, 2025

I tried to add compare two values but that didn't seem to make any difference at all.

 

1.pngScreenshot 2025-02-07 144911.png

Vishal Biyani
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 Leaders.
February 7, 2025

@Pasi Pönkkö 

For isssuetype = Task, there is a field under timetracking i.e. timeSpentSeconds.

As an alternative approach, after your JQL, you get each task.

Can you use combination of branch for children and lookupissues + edit field to see if this serves your purpose? 

Suggest an answer

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

Atlassian Community Events