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

Automation Transition : Create Multiple Sub Tasks Dynamically Based on Field Value

Asheesh September 22, 2024 edited

 

 Hi,

Create Multiple Sub Tasks, based on a field value, for example if UT-IssueCount is 3 , then we should create 3 Sub Tasks.

All during transitions from one stage to another.

Though, rule is working, but only once, no errors etc.

Have a look at the screen shot attached, for information. 

Screenshot 2024-09-22 at 7.31.46 PM.png Screenshot 2024-09-22 at 7.32.05 PM.png

2 answers

1 accepted

1 vote
Answer accepted
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.
September 22, 2024 edited

Hi @Asheesh 

What is the type of your field, UT-IssueCount?  Is it a numeric field?

Please show an image of your advanced branch to provide context.

Until we see those...

There is no built-in branch type to iterate over a numeric value.  Instead you may try a couple of possible workarounds:

Please note the first technique is limited to 100 items as that is the branching limit.  The second technique might be limited to 10 items due to the service limit for recursive rules.

Kind regards,
Bill

Asheesh September 22, 2024

Thanks a lot Bill, the data type is indeed numeric.

Let me try your suggestive rightPad function.

 

Meanwhile have a look at the attached screen shot.

Regards

Asheesh

Asheesh September 22, 2024 edited

 

Screen Shot Attached

Asheesh September 22, 2024

Screen Shot

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.
September 22, 2024

Your screen images did not post, but they may not be needed.  As your field is numeric please try the rightPad() technique and let me know how that helps.  Thanks!

Asheesh September 22, 2024

Thanks Bill, 

Planning to remove this one & replace it another one.

Could you please advise the data type/field type to be used.

 

Regards

Asheesh

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.
September 22, 2024

Please clarify what you mean by remove / replace.

The number field will work with the rightPad() technique to branch for a number of times: https://community.atlassian.com/t5/Automation-articles/Branching-over-smart-values-in-Jira-Automation/ba-p/1741935#M531

Asheesh September 22, 2024 edited

Bill,

Looks I am confused with rightPad() function, could you please write syntax/use of rightPad() with Number data type.

{{issue.UT-IssueCount}} ........Numeric Variable 

Regards

Asheesh

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.
September 22, 2024

Your custom number field would substitute in the example I provided.  And so the value of the varLoopValues variable would be:

{{varLoopValues.rightPad(varLoopValues.length.plus(issue."UT-IssueCount"), "X").remove("NULL").replaceAll("X","X,").substringBeforeLast(",")}}

Assuming that is the correct smart value for your field.

If that does not help, please pause to review the other post I linked to and check your rule steps.  Then post an image of your complete rule and the audit log details for context.

Asheesh September 22, 2024

Thanks Bill. Will try.

Asheesh September 22, 2024

Hello Bill,

Getting errors, attached screen shots, 

@https://community.atlassian.com/t5/Automation-articles/Branching-over-smart-values-in-Jira-Automation/ba-p/1741935/page/2#U2818662

 

Thanks

Asheeshhttps://community.atlassian.com/t5/Automation-articles/Branching-over-smart-values-in-Jira-Automation/ba-p/1741935/page/2#U2818662 

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.
September 23, 2024

@Asheesh -- I responded on the other thread as you are missing several steps to use the rule technique I described.

Kind regards,
Bill

Asheesh September 23, 2024

Thanks Bill

Asheesh September 24, 2024

Bill,

Updated workflow, have a look at the diagram, only 1 sub issue is created

Asheesh September 24, 2024

Screenshot 2024-09-24 at 3.22.25 PM.png

Asheesh September 24, 2024

Screenshot 2024-09-24 at 3.23.09 PM.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.
September 24, 2024

In the advanced branch, it needs to split the values.  Please see the original post for context.

  • advanced branch:
    • smart value: {{varLoopValues.split(",")}}
    • variable name: varLoopVariable

 

Also as you create a rule, it can help to write values to the audit log to assess progress.  I recommend adding the variable to the audit log immediately before the branch to confirm it contains what you expect:

  • action: log
    • the variable contains: {{varLoopValues}}

 

Asheesh September 24, 2024

Thanks, let me try

Asheesh September 24, 2024

Bill,

Please find attached log message

Screenshot 2024-09-24 at 10.35.41 PM.png

Asheesh September 24, 2024

Screenshot 2024-09-24 at 10.38.14 PM.png

Asheesh September 24, 2024

Thanks a TON Bill, it's working.

Like • Bill Sheboy likes this
0 votes
Manoj Gangwar
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2024

Hi @Asheesh Welcome to the community! 

You can use the IF Else condition

If count 1 then create 1 subtask

Else count 2 then create 2 subtasks

Else count 3 then create 3 subtasks

Asheesh September 22, 2024

Thanks, good idea. But if its say 7 then it may become clumsy.

Like • Manoj Gangwar likes this
Asheesh September 22, 2024

Hello Manoj,

Looks there is some issue with current release of Jira Cloud, although I could add If-Else_Block, but while setting it up could not see an option to add else condition.

Could you please check.

Thanks

Asheesh

 

Manoj Gangwar
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2024

Please share the screenshot of IF block condition. 

Asheesh September 22, 2024

Image

Asheesh September 22, 2024

Image

 

Asheesh September 22, 2024

Unable to add an image.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
atlassian, ace, atlassian community event, donation, girls who code, women in tech, malala fund, plan international, kudos, community badge, badge, atlassian badge, International Women’s month, International Women’s Day, women's month, women's day

10 for Change at Atlassian Community Events

Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!

Join an Atlassian Community Event!
AUG Leaders

Upcoming Jira Events