Forums

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

Copy one custom field value to another custom field in Automation

Matthew Pears
Contributor
February 27, 2022

I have one custom field that I need to copy the value of to another custom field. Both fields are numeric. 

Its seems the current configuration isnt working. 

Copy From: YTD Development Hours (customfield_10126)

Copy To: Hours Summary (customfield_10129)

The Automation rule does not execute with the configuration i've showed. Perhaps I need to add JSON to do this, which I am not very familiar with. Any help would be greatly appreciated. 

Copy Field Value .png

4 answers

1 accepted

5 votes
Answer accepted
d_kirsching
Contributor
February 27, 2022

Hi @Matthew Pears 

you can just copy in field with smart values.

For example {{customfield_10126}}.

To find if smart value is right you can check API value with this link : 

https://test.atlassian.net/rest/api/3/issue/IT-1

( replace you instance name and your issue key ).

Capture d’écran 2022-02-27 à 09.32.21.png

Matthew Pears
Contributor
February 27, 2022

Hi @d_kirsching - Thank you. 

So, I did what you suggested and the the field I want to copy TO is still not pulling in the data from the other field. I checked the API value, and it apears I am doing everything correct. 

One thing to note, the value in Customfield_10126 will change periodically. I am not sure if this will affect how the smart value is written. 

image.png

image.png

d_kirsching
Contributor
February 27, 2022

Hi @Matthew Pears 

I've tested 2 numeric fields. And for me it's working.

Please find in following screenshots my automation rule and result.

Capture d’écran 2022-02-27 à 19.09.47.pngCapture d’écran 2022-02-27 à 19.09.39.pngCapture d’écran 2022-02-27 à 19.09.25.png

Like # people like this
Matthew Pears
Contributor
February 27, 2022

@d_kirsching I think we are close, thnka you for working on this with me. 

Here is what I have set up: 

First Action: CF_10129 is the field that I want to Copy TO

Second Action: CF_10126 is the field where I want to Copy From 

Third Action: Hours Summary is where data should be Copy TO

Is this setup correctly? 

Also, one thing to note: CF_10126 key is MON-82 and CF_10129 key is MON-62. In short, these fields are on different issue types. 

image.png

d_kirsching
Contributor
February 27, 2022

Ok I understand. Maybe the right way is to link issues before.

And use this smart value : {{triggerissue.customfield_10126}}

Capture d’écran 2022-02-27 à 19.58.24.pngCapture d’écran 2022-02-27 à 19.58.17.pngCapture d’écran 2022-02-27 à 19.58.00.png

Like Matthew Pears likes this
Matthew Pears
Contributor
February 27, 2022

@d_kirsching Ok I will try. SO I understand your order of operation. Can you please define your Custom Fields for me?

d_kirsching
Contributor
February 27, 2022

@Matthew Pears 

Custom fields are just Numeric.

Capture d’écran 2022-02-27 à 20.33.17.png

Matthew Pears
Contributor
February 27, 2022

@d_kirsching you're awesome. Linking the issue and including the Smart Value in the last action worked like a charm!!!!

Thank you so much. 

d_kirsching
Contributor
February 27, 2022

Glad to help :) 

0 votes
d_kirsching
Contributor
March 15, 2022

Hi @Matthew Pears 

You can create a variable to grep customfield.

And edit subtasks.

Use variable smart value, in my case {{copyhours}}

Capture d’écran 2022-03-15 à 13.27.32.png

Matthew Pears
Contributor
March 15, 2022

@d_kirsching - looks like I cant get this rule to execute. 

Screenshot 2022-03-15 144622.png

I must have something not entered correctly. I have two questions 

1. from your image, what is your customfield_10601? 

2. from your image, what are the details of the last "total hours" action

d_kirsching
Contributor
March 15, 2022

Hi @Matthew Pears 

customfield_10601 is your Customfield_10149

Capture d’écran 2022-03-16 à 07.51.36.png

Matthew Pears
Contributor
March 16, 2022

@d_kirsching I am having a hard time with this. I am not sure why the rule is still not executing. My last action appears to mirror yours. 

 

Screenshot 2022-03-16 092426.png

0 votes
d_kirsching
Contributor
March 14, 2022

Hi @Matthew Pears 

I'm seeing that your trigger is when Issue is updated.

What is updated ? Main issue or Subtasks ? 

For me it's working when subtasks are updated.

Regards

Capture d’écran 2022-03-14 à 20.21.48.png

Matthew Pears
Contributor
March 14, 2022

@d_kirsching 

ALEX-754 in the main issue, which is where Hours Summary is located. 

The subtask, ALEX-758 and ALEX-759 are what is being updated, specifically, the Total Hours field respectively. 

0 votes
Matthew Pears
Contributor
March 14, 2022

@d_kirsching Hoping you can help me with another problem related to this thread. Here is my scenario. 

I have a custom numeric field, Hours Summary, customfield_10129. Its Issue key is ALEX-754. 

Then I have another field, Total Hours, customfield_10149, on two different subtasks. Their keys are ALEX-758 and ALEX-759. Of note, the issues are linked to ALEX-754. (Disregard current values)

Screenshot 2022-03-14 132714.png

 

I want to sum, Total Hours across 758 and 759 and copy them to the Hours Summary field. 

 

I cannot get this to work.

Screenshot 2022-03-14 131515.pngHere is the full code: {{#=}}{{triggerissue.customfield_10149.ALEX-759}} + {{triggerissue.customfield_10149.ALEX-758}}{{/}}

Then, I keep getting this error: 

 

Screenshot 2022-03-14 132511.png

d_kirsching
Contributor
March 14, 2022

Hi @Matthew Pears 

I think I have it. We need to get values when a subtask is updated.

Use triggers ( on picture ) and this smart value : 

{{lookupIssues.customfield_10149.sum|0}}

Let me know.

Capture d’écran 2022-03-14 à 21.04.07.png

Like Matthew Pears likes this
Matthew Pears
Contributor
March 14, 2022

@d_kirsching  OK - we are almost there. The Automation worked perfectly, however we need to make a tweak. 

Total Hours (Customfield_10149) is being imputed on two different subtasks. Screenshot 2022-03-14 231626.png

Here are the fields in each of these subtask. The fields are exactly the same. 

Screenshot 2022-03-14 232032.png

In short, as the Total Hours value changes, I need their respective Total Hours field summed, and reflected in Hours Summary (customfield_10129), which lives on the parent issue ALEX-754. 

See the Parent Image:

Screenshot 2022-03-14 232844.png

As of now, the updated rule will change the value of Hours Summary, but only from one of the subtask that was updated most recently. As opposed to summing Total Hours together from both subtasks, then updating Hours Summary. 

Hope this context helps. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events