I want to lookup the Issues of an Certain list and Set the Due Date individually for Each item i attained it Throuh Lookup issues and then in branching why i was not able to use the IF else block and if i use the Edit Work item with the Smart value and use if Else am not geting the Expected Result its not updating i have loged action in each and every step and the only problem is with the IF Else Smart Value
{{#if(equals(issue."Story Points",1.0))}}
{{issue."Start date".plusDays(2).jiraDate}}
{{else}}
{{#if(equals(issue."Story Points",2.0))}}
{{issue."Start date".plusDays(3).jiraDate}}
{{else}}
{{#if(equals(issue."Story Points",3.0))}}
{{issue."Start date".plusDays(5).jiraDate}}
{{else}}
{{#if(equals(issue."Story Points",5.0))}}
{{issue."Start date".plusDays(7).jiraDate}}
{{else}}
{{#if(equals(issue."Story Points",8.0))}}
{{issue."Start date".plusDays(10).jiraDate}}
{{else}}
{{#if(equals(issue."Story Points",13.0))}}
{{issue."Start date".plusDays(15).jiraDate}}
{{else}}
{{#if(equals(issue."Story Points",21.0))}}
{{issue."Start date".plusDays(25).jiraDate}}
{{else}}
{{issue."Start date".plusDays(7).jiraDate}}
{{/}}
{{/}}
{{/}}
{{/}}
{{/}}
{{/}}
{{/}}
Hi @SOMASUNDARA BHARATHI
Welcome to the Atlassian Community!
In this case, the lookup and branch are probably not the issue if your log actions are already showing the correct issues. The issue is more likely with the smart value syntax used in the Edit work item action.
Firstly, I will not use this format.
{{issue."Story Points"}}
{{issue."Start date"}}
Try this one:
{{issue.Story Points}}
{{issue.Start date}}
Also, Story Points can sometimes return as a number without .0, so I would compare it with 1, 2, 3, etc. instead of 1.0, 2.0.
Try this full version of the logic.
{{#if(equals(issue.Story Points,1))}}
{{issue.Start date.plusDays(2).jiraDate}}
{{else}}
{{#if(equals(issue.Story Points,2))}}
{{issue.Start date.plusDays(3).jiraDate}}
{{else}}
{{#if(equals(issue.Story Points,3))}}
{{issue.Start date.plusDays(5).jiraDate}}
{{else}}
{{#if(equals(issue.Story Points,5))}}
{{issue.Start date.plusDays(7).jiraDate}}
{{else}}
{{#if(equals(issue.Story Points,8))}}
{{issue.Start date.plusDays(10).jiraDate}}
{{else}}
{{#if(equals(issue.Story Points,13))}}
{{issue.Start date.plusDays(15).jiraDate}}
{{else}}
{{#if(equals(issue.Story Points,21))}}
{{issue.Start date.plusDays(25).jiraDate}}
{{else}}
{{issue.Start date.plusDays(7).jiraDate}}
{{/}}
{{/}}
{{/}}
{{/}}
{{/}}
{{/}}
{{/}}
I also recommend setting a log action inside the branch.
Issue: {{issue.key}}
Story Points: {{issue.Story Points}}
Start date: {{issue.Start date}}
Calculated Due Date:
{{#if(equals(issue.Story Points,1))}}
{{issue.Start date.plusDays(2).jiraDate}}
{{else}}
{{issue.Start date.plusDays(7).jiraDate}}
{{/}}
If Story Points or Start date is empty in the log, then Jira Automation is not reading the field with that smart value name. In that case, use the field ID instead.
Hello @SOMASUNDARA BHARATHI
I would recommend using the field IDs instead of field names if the rule still does not update. Field names with spaces or duplicate custom field names can be unreliable in automation.
Second, if you need help investigating what is not working, please paste screenshots of the automation here.
The full context is important, not only the single part that appears to be failing. Otherwise, it is a bit like trying to treat a patient without being able to see them.
Best,
Arek🤠
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gor's already put his finger on why the Edit action wasn't updating, and that part's correct — in the ternary it needs to be {{issue.Story Points}} without the quotes, and the comparison values catch people out because the field can come through as 1.0 rather than 1. Easiest way to pin it down is to drop a Log action printing {{issue.Story Points}} just before the Edit, then match your comparisons to exactly what it prints. Since all you're doing is setting a due date per item, that smart-value approach in the Edit is the right tool and you don't need branching for it at all.
On the title question, this is a genuine limitation in Automation. The If/else block is restricted to the main trunk of the rule, so it can't go inside a branch, and branches can't be nested inside one another either. It's a known request with Atlassian (JSWCLOUD-22798, "Allow IF/ELSE block within branches") but nothing has shipped yet.
What does still work inside a branch is a single condition — an Issue fields condition, a JQL condition or an Advanced compare condition. It only has one path though, so if it passes the iteration carries on and if it fails that iteration just stops. That covers "only act on the items matching X." If you genuinely need two different outcomes per item, you'd either split it into separate branches each guarded by its own JQL/condition, or have the branch call a second rule through an incoming-webhook trigger and put the If/else block in that rule where it's allowed on the trunk.
For what you're after here though, since it's just a due date calculated from story points and not really a two-way branch, I'd keep it as the one Edit action with the ternary — that's the cleanest fit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.