Hi everyone. I'm trying to create a smart value variable to use as part of an automation and I'm not sure why it's not working.
I want to add a label that shows the due date year when a particular kind of issue type is created. So for example if the due date is June 4, 2026, then a label that says "2026" would get added by the automation.
This is what I've set up:
And then:
But this what gets populated:
Can anyone tell me where I'm going wrong?
Thanks in advance for your help!
The Due Date field is a "date type" and Labels are text. The date value must be formatted to be used as a label, as described here: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-format---
For example, you could use this to get just the year value as text:
{{issue.duedate.format("yyyy")}}
Kind regards,
Bill
Hi Bill. Thanks for your reply.
Yes, I hadn't thought about that but it makes perfect sense. I've just tested out the string you shared and I got this:
So maybe there's some other step that I'm missing? This is what my whole automation looks like:
Any guidance would be most welcome. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would you please post images of your Edit Issue Fields action and of the audit log details showing the rule execution? Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure, thanks for the quick reply! Here's the Edit Issue action:
And here's the log entry:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I wonder if the Due Date field is empty...I see your rule is using the Issue Created trigger. That one can fire so quickly that some issue data may not yet be available to the rule.
The fix for that is to always add the Re-fetch Issue action immediately after the Issue Created trigger. This will slow down the rule a bit, reloading the data before proceeding.
Please add that action and try re-testing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill.
Just wanted to let you know that I've just discovered that my problem was in the Edit Field. Putting the actual smart value there, instead of the variable name, solved the problem.
Thanks for the suggestion about Re-Fetch action though. I didn't know about this action and have several automations where I've included delays but this will be a much better solution.
Thanks again for all of your help! Happy holidays!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is curious, as I am confident if that full expression may be used to add a label the variable's smart value could as well.
I still recommend removing the Delay() action and adding Re-fetch Issue after the trigger and testing again. This symptom seems like a timing problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, removing the delay also works!
This is the updated rule:
And this is from my issue!
Thanks Bill, that's a good learning to consider all of the different timing elements when building a rule. I'll keep that in mind as I'm building new rules.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn it is working! Please consider marking this question as "answered" to help others with a similar need find solutions faster. Thanks!
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.