For loop Automation to create issues with custom summary

perla.miranda
Contributor
October 11, 2022

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.
October 11, 2022

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

perla.miranda
Contributor
October 11, 2022

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.
October 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.

perla.miranda
Contributor
October 12, 2022

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.
October 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.

0 votes
Manu Devos October 12, 2022

@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 

perla.miranda
Contributor
October 12, 2022

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

Manu Devos October 12, 2022

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

Manu Devos October 12, 2022

@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

perla.miranda
Contributor
October 13, 2022

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
0 votes
perla.miranda
Contributor
October 11, 2022

@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