Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Use automation to clone ticket and then change epic link based on custom field

Edited

I use automation to clone a ticket automatically when needed. For exemple, in one project, I have an epic "desktop" and an epic "mobile" and I need the same ticket in both. I also need those two tickets to be independent in their workflow. 

I create a custom fields to mention in which epic I want this ticket to be clone. Then, I create an automation rule : 

- When creating a ticket, if this custom field isn't empty, clone the ticket

- Then, change the epic link of the clone ticket, using the custom field

For the custom field, I tried an URL field to complete the exact URL of the epic. I also tried a short text field to complete the key of the epic. 

In both case, it doesn't work. The ticket is well cloned but the epic is empty. Is there anyone who could help ? 

 

Here is my rule
Note that : {{customfield_11582.value}} = https://studiometa.atlassian.net/browse/SM-402 which is the link of the epic I want my issue to be

 

bef9a373-a89b-4444-af96-a47abd71eaf0.png

4 answers

Hi @Malvina Garnier 

As you are using a URL to the epic/issue in that custom field, you could extract everything before the last forward-slash.  You may do that with the substringAfterLast() function: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#substringAfterLast-String-separator-

For example to get this from the triggering issue:

{{triggerIssue.customfield_11582.value.substringAfterLast("/")}}

If that does not work, please write that value to the audit log and then check that it contains what you expect.  You may not need that .value part.

Kind regards,
Bill

Thanks for your help :)

Actually I also tried to create an ohter custom field here I only mention the key of the epic I want on the clone tickets and it doesn't work. So, I don't think that this option may work.

Thanks, Malvina.  Is this a company-managed or a team-managed project, as the Epic Link field only works for company-managed projects?

This is a company managed project 

Would you please add a log action for that value before the edit, run the rule, and then post images of the updated rule and audit log details for the execution?  Thanks!

0 votes
John Funk Community Leader Jan 03, 2022

Hi Malvina,

I don't know that you will be able to use a url for the value for it to work. If you just have SM-402 as the value of the custom field, does that work? 

Nope it doesn't work either :'( 

John Funk Community Leader Jan 03, 2022

So what is the error? 

And actually, just remove the .value part of the code for the custom field. 

I also tried, removing the .value part of the code mais it doesn't work either. 

John Funk Community Leader Jan 03, 2022

So, what is the value in the customfield_11582 field for that issue? 

The value is the key of the epic I want on the clone ticket (in my case "SM-470") but the clone ticket still have an other epic. 

John Funk Community Leader Jan 04, 2022

What does the audit log say for that action of updating the Epic Link? 

What does the history of the issue say for who populated the Epic Link? 

Are you cloning issues in a Company Managed or Team Managed project?

Hi ! In a company managed project. 

0 votes

As a workaround: You can save the epic link in a variable and then use it after cloning.

I try to do so but it doesn't work :'( 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
Community showcase
Published in Jira Software

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

469 views 19 23
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you