Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Copy worklog from a linked issue using Jira Automation

Otto Van Straaten March 3, 2021

Hi 

I currently have 2 projects. Project A is a Service Project and project B is a Business project.

 

I have a couple of basic automation rules in place. 

 

I need to copy the worklog from project B to project A using Automation.

 

I need some assistance with this as I am new to Automation and can cope with the basiscs.

 

Any assistance would be appreciated.

 

2 answers

1 vote
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 8, 2021

Hello @Otto Van Straaten ,

Using the work logged or field changed to trigger with the values for the work log, the entries for work logs are independently stored item are not tracked in Jira as a field change history item due to how the work log is stored as a specialized item apposed to a direct field value. 

So to get the time log entered into the rule you need to create a variable to store the value you want to pass to the other issues.

This can be achieved with a global automation rule, and inputting a {{Create Variable}} action to store the work log item to be reused for the follow-up actions within the linked issues.  and you can use an automation rule like this:

Screen Shot 2021-03-08 at 11.21.47 AM.png

Regards,
Earl

Otto Van Straaten March 12, 2021

Hi Earl

This works great thank you.

The only issue that I have picked up is that whenever the time is logged against the linked issue the time spent is not correct.

When time is logged the first time both issues have the exact same time spent.

When time is logged a second time it adds the original value plus the new time logged, e.g. I logged 5 mins of work in project B and the time logged is 5 mins in project A.

When I log another 5 mins in project B (total time logged 10 mins) the time logged in project A is 15min.

 

Is there a way around this?

Like Deleted user likes this
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 31, 2021

HI @Otto Van Straaten ,

I was not able to get this behavior to trigger in my test instance, so i'm wondering how do you have the rule configured, and what are the link types on the two issues used for the trigger?

I am wondering if the rule is getting triggered on multiple issue link types between the two issues,  i.e. if you have both "blocks" and "related to" the rule might be triggering for each link.

Alternatively, if the rule might be getting triggered on the issue by the rule editing the worklog, so it does a double edit, check the rule details and make sure that the option for "Allow rule Trigger: Check to allow other rule actions to trigger this rule. Only enable this if you need this rule to execute in response to another rule." is unchecked so that rule does not trigger itself reciprocally.

Let me know what you find.

Regards,
Earl

Like Deleted user likes this
Christine Corona June 7, 2021

Hi @Earl McCutcheon Thank you for providing such a simplistic solution, I've been racking my brain for days trying to get this automation to function properly. However, I'm getting the same issue as @Otto Van Straaten stated. I checked all the items you recommended and I'm only using 'relates to' and I've had the 'Allow other rule...' unselected. I also tried only using the automation for updated work logged operations and that disabled the automation completely. I'm SO close to getting this automation to work the way I need, do you have any other suggestions to make the aggregate calculation on the linked issue correct?

Use Case: 1 Issue in Project A has many issues linked from Project B. The original estimate is entered in Project A for contractual hours. Original estimates in project B are from estimates for completion of issue. We would like work logged for all issues in Project B to aggregate into logged work for Project A. 

 

Thank you, 

Christine 

Like Deleted user likes this
Jeroen Bos August 17, 2021

Try {{worklog.timespent}} as a smartvalue, rather than {{issue.worklog.timespent}}

Like Deleted user likes this
1 vote
Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 7, 2021

Hi @Otto Van Straaten 

It is possible to set worklogs on an issue using automation, by using smart values and setting the JSON values in an issues 'Additional Fields' section (see https://support.atlassian.com/jira-software-cloud/docs/advanced-field-editing-json/#field-syntax-examples for some examples of this). However, I am not sure how this automation would work, as it is expecting a trigger from an event related to an issue. What event would you be expecting to fire off your rule?

Cheers

Sam

Otto Van Straaten March 19, 2021

Hi @Sam Harding 

Thank you for the advice.

I finally got it working using Edit issue fields.

I am now struggling to get the worklog comments moved over to the linked issue.

Do you have any advise?

Screenshot_1.pngScreenshot_2.png

Bianca de Weerd
Contributor
September 28, 2021

worked

 

Like Deleted user likes this
John Fredy Diaz Zapata
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!
December 9, 2021

Hello.

This works when time is logged the first time, but if I edit the time in the original issue, in the linked issue duplicate the time.

Any idea how to control that? Thks,

Like Deleted user likes this

Suggest an answer

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

Atlassian Community Events