Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

For loop Automation to create issues with custom summary

Hi,

The following has been working for months and randomly stopped working. I'm out of ideas on what to do. No changes have been made with custom fields. This was working for various types of custom fields and stopped working for all of them.

Goal: Parent task has "Module Count" custom number field. When creating a parent task:

  1.  The automation rule reads the value and creates that many subtasks (e.g. if Module Count is 5, it creates 5 subtasks)
  2. The summary for each subtask should be "Module 1", "Module 2", etc, up until the value of Module Count

Problem: This has been working fine and stopped. Now the module subtasks are created with the same name which is "Module" followed by "Module Count". (e.g. 5 subtasks are created and are all named "Module 5", instead of iterating through the numbers).

Here is a screenshot of the rule:

for loop.png

 

--------------------------------

Here is the code for each section:

#1num_1.png

------------------------

#2num_2.png

{{#varLoopValues.rightPad(varLoopValues.length.plus(issue."Module Count"), "X").remove("NULL").replaceAll("X","X,").substringBeforeLast(",").split(",")}}{{#=}}{{index}}+1{{/}}{{^last}},{{/}}{{/}}

-------------------

#3num_3.png

-------------------------

#4num_4.png

 

 

3 answers

1 vote
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 11, 2022 • edited

Hi @perla.miranda 

In your rule before the advanced branch, would you add a write to the audit log to show the value of {{varLoopValues}} then run your rule and post an image of the audit log details?  That may help to isolate this symptom a bit.  Thanks!

As a reference for other readers, this question is following up from a technique described in this article's thread: https://community.atlassian.com/t5/Automation-articles/Branching-over-smart-values-in-Jira-Automation/ba-p/1741935

Kind regards,
Bill

For {{varLoopValues}}, I got the following which seems right when I placed it before the advanced branch.

log1.png

But then I tried another log under the advanced branch for {{varLoopVariable}} and I got just 3, when I set the custom field to 3

log2.png

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 12, 2022

That first log is correct and the second one is not.

I just retested this and advanced branch over a smart value list is also not working, per that defect noted by @Manu Devos so I will add a comment to the defect.

Thank you! If you are aware of any workaround, please let us know. I appreciate you looking into this :)

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 12, 2022

Until that defect/symptom is fixed I believe you are blocked for your use case.  The only work-around would be to manually create, clone, or import issues...and perhaps disable that rule for a while.

@perla.miranda We've been struggling all day with why this was not working for us and just noticed this bug was created: 

https://jira.atlassian.com/projects/AUTO/issues/AUTO-179 

Wow, this is really helpful. Thank you. Have you tried any workaround?

Sadly in our cloud instance the provided workaround doesn't seem to be available.
We've opened a support ticket as well

@perla.miranda Just to inform you, we've retried running our rules this morning and they seem to be working as intended at this moment. Haven't had official feedback from Atlassian yet though

I just checked and they are working now! Great! I was already going to take some time to Script them through script runner today and I was not looking forward to it haha! Looks like they added a comment that it is fixed now fixed: https://jira.atlassian.com/browse/AUTO-179

 

Thank you for taking your time to point me to bug logged, and it was helpful to know this was not occurring to our team only. Thank you @Bill Sheboy as well for helping me confirm that it was an Atlassian bug.

Like Bill Sheboy likes this

@Bill Sheboy you helped me with this last time so hoping we can figure out what happened here and if anything is no longer supported. Thank you

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events