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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Malvina. Is this a company-managed or a team-managed project, as the Epic Link field only works for company-managed projects?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So what is the error?
And actually, just remove the .value part of the code for the custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also tried, removing the .value part of the code mais it doesn't work either.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, what is the value in the customfield_11582 field for that issue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you cloning issues in a Company Managed or Team Managed project?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As a workaround: You can save the epic link in a variable and then use it after cloning.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.