Forums

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

How to edit logged time inherited from trigger issue?

Adrian Kraska November 5, 2020

Hi!

I'm using Workflow Toolbox post functions to create issues with particular statuses. To create them I've used "Inherit remaining fields" - this option copies values of custom fields from trigger issue and put them into new issue. image.png

There is just one thing - I did not know that it copies "Log work" as well...

Every subtask created by workflow multiplies logged time in my project. Here is an example:
 image.png

As you can see in this particular issue, there is only one record with logged time - 15 minutes. But in the top right corner of the screenshot, it states that there are 35 minutes logged - those remaining 20 minutes are from an issue that triggered the creation of this one. 

And now, here is the question - how to delete that 20 minutes?

Thanks in advance!

1 answer

0 votes
Thorsten Letschert _Decadis AG_
Atlassian Partner
November 5, 2020

Hi @Adrian Kraska ,

please add the following to the Set fields block of the Create issue post function creating your sub-tasks:

  • Add field 'Add to time spent minutes'
  • Value type 'Math/Time expression'
  • Expression
- {00025}

The result should look like this:

jwt_community_time-spent.PNG

With that adjustment, newly created sub-tasks start with a time spent of 0 even with time logged to the parent issue before.

Cheers
Thorsten

Adrian Kraska November 5, 2020

Hi @Thorsten Letschert _Decadis AG_ !

I did it already, new tasks are correct, but my main concern is what to do with already existing issues - the time is filled wrong already in those, and I have no idea how to deal with it. 

Do you have any ideas? :)

Thorsten Letschert _Decadis AG_
Atlassian Partner
November 5, 2020

Hi @Adrian Kraska ,

if you're running Jira Workflow Toolbox 2.9.0 or above, I'd go for the automation rules (see https://apps.decadis.net/display/JWT/Automation+rules).

The quickest way depends on the question of how many issues already have received additional timelogs.

If you want to just reset issues to a time spent of 0, you could use a manual rule like this (replacing the JQL 'project = DEMO' with the one that matches your scenario, e.g. the affected sub-tasks):

jwt_community_time-spent_rule01.PNG

A more elegant way would be a manual rule like this (again replacing the JQL):

jwt_community_time-spent_rule02.PNG

The expression used is:

timeLogged(issueKeysToIssueList(%{selector.issue.key}),{selector.issue.created},{system.currentDateTime}) / {MINUTE}

This rule updates the total time spent to the sum of all time logs done after ticket creation. Additional hint: if you use 'key = ABC-1' as the JQL within the selector, you can test the whole thing on a single issue before doing a bulk update.

I hope that helps.

Cheers
Thorsten

Adrian Kraska November 5, 2020

@Thorsten Letschert _Decadis AG_ thank you very much for your effort, really appreciated!

Unfortunately, it does not work for me. On my side, it looks like this:
image.pngI'm sure that expression works, as I've tested it in Jira search engine:
image.png

There is no change. I've tried it on few issues to be 100% sure :)
image.png

image.png

Again, thank you for your help :)

 

Suggest an answer

Log in or Sign up to answer