I have an automation that is manually triggered which clones a task and its subtasks. The cloning needs to happen each quarter and there are over 100 subtasks ranked intentionally. When the automation runs, the resulting list of subtasks is in reverse rank order due to the fact that the subtasks were evidently cloned starting with the highest issuekey to the lowest ... in our use case then, from the lowest-ranked issue to the top-ranked issue. This is problematic due to the subsequent need to manually re-rank the subtasks every quarter.
Any thoughts on how to overcome this behavior?
Hi @Rick Crow
Let's backup a bit and confirm what problem you are trying to solve. That will help the community suggest ideas.
What do you need to do with the automation rule that cannot be done by manually cloning?
Thanks!
Bill, great point! I guess I haven't used that feature for so long, it just didn't come to mind as an option.
The only problem I'm seeing with that is that the resulting subtask names are all prefixed by "Clone - " and there's no option to affect this manually. I'm hoping there's a way to strip those prefixes as part of another automation ... I'll start looking now.
-----
Update ... figured out that last part!:
{{issue.summary.substringAfterLast("- ")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks! So try this:
You can read about that function here:
https://support.atlassian.com/jira-software-cloud/docs/smart-values-text-fields/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Exactly!
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Brilliant!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Rick Crow
I haven't tried this, but I wonder if instead of using the clone action, you use JQL to return the subtasks in rank order, and then iterate over them individually.
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rick,
I'd have a crack at what Bill has suggested, it sounds like a sound approach!
Cheers,
Simeon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I’m not sure what that looks like after the JQL to find and order the subtasks if not using the clone issue action, however.
Also, the behavior I’m seeing, IMHO, should be altered so that the original subtask order/rank is preserved given the expectation of a clone action ... as is, it’s more of a ‘mirror’ action. 😎
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Haven't tried this either, but maybe the JQL would look like:
issuetype = Sub-task ORDER by key
Try that out in the advanced filter section first to see results
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Without the clone action, what action would I use to create the subtask copies? Also, I assume 'use JQL' means I should use the 'For JQL' branch rule rather than the 'For Subtasks' branch rule? I've tried it that way, as well as by keeping the same 'For Subtasks' branch rule followed by a JQL condition.
So far, my attempts at the suggested approach (and any variations) have resulted in a disconnect between the new subtasks and the new parent task ... even though I'm using this code in the 'more options' area, which worked with my original approach (without the JQL).
"fields": {"parent": { "key": "{{createdIssues.first.key}}" }
On the positive side, the error message in the log for this rule does seem to list the failed subtask creation steps in the correct order as opposed to what I've seen earlier where they were listed in a reverse-ish, random order.
CC: @Simmo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Greetings, all!
Replacing my earlier response...
It does not appear there is a way to query and order subtasks for a parent. The information is in the issueLinks table, but that value's sequence attribute is not sortable.
Sorry for the detour, community!
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Was just thinking the that key represents the order they were created.
I have to confess, I don't under the whole ranking business and how that is done by the system. Keys I know! :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.