You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi, I am trying to set due dates based on the Component that is set on the Story (Small, Medium, Large). Note that I copy the Components to the sub-tasks in an attempt to simplify the logic of looking up the Components.
I created an if else-if branch to manage these three conditions, and in each I set a variable to hold the date.
Right after the variable is set, I have a For Parent branch to create sub-tasks and assign due dates...but they are turning up blank.
So I added a test audit log entry to see if the variable existed even just after the if else-if branch ended and it doesn't. It's already null.
I can see in the rule audit log that the condition passes successfully so why is my variable null?
Is the log action within the if/else block or outside? The screenshots indicate that it is outside of the if/else block and that would explain why the variable is null. A smart value that is created with a if/else block is only available within that block and cannot be accessed outside of it.
Outside. The article where they launched this feature says exactly this:
This article is for the power users of Jira automation to show you how to use our new 'Create variable' action.
This new action allows you to define your own smart value, which can be used in other actions and conditions in the same rule.
So to me it makes no sense that it is confined to only the if else block. Maybe they'll broaden in the future.
It depends on where you create the variable. If you look in the article they are creating the variable first before using it in the branch. If the variable is created with the branch, you will not be able to access it outside of that branch, that's the difference.
I haven't tried this but can you create it outside the if/else block and then set in inside?
@Kelly Arrey yes, if you create the variable outside of the if/else block it becomes a global variable and can then be used inside the if/else block. Have a look at the article above that Derek linked to.
Correct, you will have to use the create a variable multiple times, but as long as you use the same name it will just update the value for the variable.