How to clone information from custom fields of one issue to another issue

Alex Shirokov
Contributor
March 2, 2022

Hi, 

I tried to build an automation rule but failed.

I create the first Epic for my project (info Epic) it contains a lot of info (metadata) in the custom fields. 

I need to clone these metadata from the first Epic to all other Epics I will create for this project. 

I created a custom field "Metadata Epic" that serves as a trigger for other Epics to collect data from... and that was it :) 

I found out how to clone the entire issue BUT not the data from the custom fields. 

Many thanks in advance for your help! 

 

2 answers

2 votes
Alex Shirokov
Contributor
April 18, 2022

@Ste Wright Thank you very much Stephen! 
I’d be happy to get your advise how to achieve my scope. 
I just feel a uncomfortable to take your time 🙂. 

Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 19, 2022

Hi @Alex Shirokov 

No worries - what is it that still isn't working from the previous answer?

Ste

0 votes
Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 27, 2022

Hi @Alex Shirokov 

Are you looking to populate this data from the Template Epic, into all other Epics created?

Almost like...

  • Trigger: Issue Created
  • Condition: Issue Type = Epic
  • Action: Edit Issue - copy metadata from Template Epic

What does your current rule look like? And what limitation are you finding? And how do you create these new Epics, if not as a clone?

Ste

Alex Shirokov
Contributor
March 27, 2022

Hi Stephen, 

thank you for your reply. 

How should I show in my rule what is the "Template Epic" is? 

I tried to do it via JQL "issuetype = Epic AND text ~ "Project Summary" ORDER BY created DESC"

I do not understand how to map this "Main Epic" to get information to be copied to a new Epic.

Thank you 

Al

Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 28, 2022

Hi @Alex Shirokov 

I got this working using two separate Automation rules...

  • Rule 1: Link to Template Epic
  • Rule 2: Update new Epic

 


Rule 1 - Link to Template Epic

  • Trigger: Issue Created
  • Condition: Issue Fields Condition - Issue Type = Epic
  • Action: Edit Issue
    • Field: Linked Issues
    • Link: clones - TEST-1

Notes:

  • This creates a link to the Template Epic
  • The link type can be whatever you like
  • Whilst it's not obvious, in the Action it is possible to type a Key into the second drop-down - even though it isn't an option in the list.

 


Rule 2 - Update new Epic

  • Trigger: Issue Linked - type = Cloners
  • Condition: JQL Condition - issuetype = Epic and createdDate >= -1m and issueClones = TEST-1
  • Action: Edit Issue
    • Set fields. Set field data using smart values - {{destinationissue.field}}
      • For example Template Epic's Summary = {{destinationissue.summary}}

After creating the rule, go to Rule Details - and check the box next to 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.

Notes:

  • The Rule Details checkbox allows for Rule 1 to activate Rule 2
  • The Condition ensures it's activating only at creation (i.e within 1 minute)
  • The Action can set whatever number of fields is required
  • {{destinationissue}} refers to the Template Epic, in this instance. This smart value can be used in a range of fields.

 


This works for me! There might be a more elegant option using variables, but I found having multiple custom fields to copy made that overly complex. 

Let us know if this could work for you! Or if you have any further questions, please feel free to ask them :)

Ste

Alex Shirokov
Contributor
March 30, 2022

Hi Stephen Wright _Elabor8, 

Thank you a million for your reply! 

I'll try to replicate what you suggest to do. 

Thanks again!

Like Ste Wright likes this
Alex Shirokov
Contributor
March 30, 2022

Hi @Ste Wright 

Maybe I have a brain disorder but.. in the first step I can only progress to Action --> Edit Fields and after ... I do not have a choice of clone in my drop down.

Screenshot_2.png

 

Even if I would have I need to have some kind of formula showing that I need to clone only the Epic that contains in its name a "- Project summary". 

This Epic will contain some very specific custom fields which information that should be cloned to any other Epic created.

Therefore, I believe that the JQL in step 2
"Condition: JQL Condition - issuetype = Epic and createdDate >= -1m and issueClones = TEST-1" won't work for me

 

Stephen, I know how it is annoying for you, therefore I really do appreciate your help!

Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 30, 2022

Hi @Alex Shirokov 

A few questions, so a few answers!

 


I can only progress to Action --> Edit Fields and after ... I do not have a choice of clone in my drop down.

^ Just to confirm, from the field drop-down, you are selecting the field Linked Issues? 

Clones is a linked issue type, so only available once the field has been selected from a separate drop-down which will appear.

You can select another link type if preferred, it's up to you which one :)

If the link type is missing, or you want to add a new one, follow these instructions.

 


Even if I would have I need to have some kind of formula showing that I need to clone only the Epic that contains in its name a "- Project summary". 

^ The first rule only links the newly created Epic to the "Template Epic" (which should have these fields populated).

The second rule is where you set the fields to copy across from the template.

 


"Condition: JQL Condition - issuetype = Epic and createdDate >= -1m and issueClones = TEST-1" won't work for me

^ You might need to modify this slightly if you use a different link type, but this just finds a recently created Epic to copy fields to - nothing else.

Why wouldn't this work in your scenario?

 


Screenshots might be useful here to clarify some questions - if these answers aren't sufficient clarification!

Feel free to send through your specific needs also in terms of fields, happy to help with more descriptive instructions if needed.

Ste

Like Alex Shirokov likes this
Alex Shirokov
Contributor
April 3, 2022

Hi Stephen, 

My sincere apologies that I'm late with my answer and a big THANK YOU!!!

I presume I did not properly describe the dilemma I'm facing. I'll try with screenshots :)

I tried what you described but I failed.

Let me provide more details.

I have numerous projects (over 200) in my PMO org. Every single PMO project starts with an Epic that has in its name "Project Summary" (example: Test1Project- Project Summary). This Epic contains a lot of metadata (over 30 fields). 

metadata.png

I have a requirement to automatically clone any of these metadata to corresponding fields of a newly created Epic(s) within the PMO project. NOTE: only for all those projects that start with an Epic that contains - "Project Summary".

So, in my understanding, I need to link to a project name (with the keyword Project Summary) and not to the previously created Epic. If I create a global rule "previously created" then all Epics across the company will close some fields they have in common (due date, start date, etc.)

Based on what I described I want to clarify with you the following: 

Rule No.1 

My questions are within pictures.

rule1.pngrule1_2.png

 

Rule No.2

The JQL does not work for me. I tried to use the one you proposed

Rule2_1.png

I'll be much appreciated if you can help me! 

Thank you in advance,

Al

Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 8, 2022

Hi @Alex Shirokov 

Some further answers below!

 


I have a requirement to automatically clone any of these metadata to corresponding fields of a newly created Epic(s) within the PMO project. NOTE: only for all those projects that start with an Epic that contains - "Project Summary".

Rule 1 can be modified to meet this need.

For example, you could add an additional Issue Fields Condition, before the action:

  • Field: Summary
  • Condition: contains
  • Value: Project Summary

This would limit the impact of the rule.

 


Rule 1 - Action:

To clarify, I'm using a template Epic - i.e an actual Issue to copy the data from. This references your original comments around copying from the "first Epic"

  • You need to link to the template Epicso whichever Epic is the template that all this metadata is copied from
  • It should be the Epic's issue key - this is the unique identifier at the end of an Issue's URL - eg. /browse/TEST-1

 


Rule 2 - JQL:

  • Similar to the above, you need to use the template Epic's issue key you link the Issues to, in the JQL

 


Potential Alternative

If simpler, you could build all this metadata into one Automation rule, and save the need for a second rule?

For example...

  • Trigger: Issue Created
  • Condition: Issue Fields Condition
    • Field: Issue Type 
    • Condition: equals
    • Value: Epic
  • Condition: Issue Fields Condition
    • Field: Summary
    • Condition: contains
    • Value: Project Summary
  • Action: Edit Issue
    • ...set all metadata required on an Epic at creation (i.e enter data for the 30+ fields in here)

 


Let us know if this makes sense :)

Ste

Alex Shirokov
Contributor
April 18, 2022

Hi Stephen, 

I spent two weeks and unfortunately, it does not work. 

I'm trying to play with different options to solve the problem. 

Thank you very much for all your help! 

Like Ste Wright likes this
Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 18, 2022

Hi Alex,

No problem :) - let us know if you'd like to get this working in future; I built it to test the theory and it works, so I would be happy to assist :)

Ste

Like Jocsan Flores likes this

Suggest an answer

Log in or Sign up to answer