Hi everyone,
I'm running into a baffling issue with a Jira Automation rule where a variable comparison fails, even though logging shows the values should be identical. I'm hoping someone in the community has seen this before.
My Goal
When an issue in our main "PROD" project is moved to a new sprint (e.g., PROD_2025_W35_W36), I want to find the corresponding sprint in all of its linked issues (which are in different projects like "BSE", "QA") and update them automatically. The sprint names share a pattern but have a different project key (e.g., BSE_2025_W35_W36).
My Approach
I've built what I believe is a robust rule to handle this. Here is the logic within the branch for each linked issue:
Create a lookup table (tblSprintIds) to dynamically find the correct Agile Board ID for each linked issue's project ({{tblSprintIds.get(issue.project.key)}}).
Create a variable (sprintCalculated) to hold the exact target sprint name. The smart value is {{issue.project.key}}_{{triggerIssue.sprint.name.substringAfter("_").trim()}}.
Send a web request to get all active and future sprints from the correct board using the Board ID from the lookup table. The URL is: .../rest/agile/1.0/board/{{tblSprintIds.get(issue.project.key)}}/sprint?state=active,future
Find the Sprint ID by iterating through the webResponse and create a new variable sprintId.
Edit the issue to set the sprint using the found sprintId.
The Problem
The rule executes without failing, but it never finds a result. The issue is in Step 4. I have isolated the problem to this specific smart value, which is supposed to find the ID:
{{#webResponse.body.values}}
{{#if(equals(name, sprintCalculated))}}
{{id}}
{{/}}
{{/}}This code always produces an empty result. However, if I hardcode the string, it works perfectly.
This works:
{{#webResponse.body.values}}
{{#if(equals(name, "BSE_2025_W35_W36"))}} <-- Hardcoded string
{{id}}
{{/}}
{{/}}This correctly finds and returns the sprint ID (e.g., 2697).
What I've Tried
This seems like an issue with the sprintCalculated variable, but I've confirmed the following:
Logging: I've added a log action right before the failing step to print both the variable and the hardcoded string. They appear to be identical.
Trimming: I am using .trim() when creating the sprintCalculated variable to remove any potential leading/trailing whitespace.
Alternative Functions: I have also tried using the match() function with regex, which also fails to find a match when using the variable but works with a hardcoded string.
This proves that the webResponse data is correct and the if/equals logic is valid, but the variable sprintCalculated is not being treated the same as a literal string within the comparison.
My Question
Has anyone encountered a situation where a smart value variable fails in a comparison (.equals() or .match()), while a hardcoded string with the same value succeeds?
Is there a known issue with variable typing, scope, or hidden characters inside Jira's smart value engine that could explain this behavior?
Any insight would be greatly appreciated. Thanks!