Hi people,
i am making an automation which is scheduled and runs to edit the summary of a ticket like: First half of March or Second half of February or whatever - depending on the current date/number of day of month,
Here is what chat gpt gave me:
{{#if(now.dayOfMonth <= 15)}}First Half of {{now.monthAsText}}{{else}}Second Half of {{now.monthAsText}}{{/}}
but it does not seem to be working
Your problem statement is not clear.
if you want to have a logic for 1st half of the month or 2nd half, this is how if works
{{if(now.format("d").asNumber.lt(15), "First half", "Second half")}}
Hi @Vishal Biyani you understood it right, but it seems like it always prints Second half - as in whatever the second value is
Also when i write {{if(now.format("d").asNumber)}} it prints nothing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you confirm you are using cloud?
In datacenter all automation rules may not work like cloud.
When I tried with
{{if(now.format("d").asNumber.lt(10), "First half", "Second half")}}
I am getting Second half.
if I try with
{{if(now.format("d").asNumber.lt(15), "First half", "Second half")}}
I am getting first half
To print the value you need to do
{{now.format("d").asNumber}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
in JIRA DC, as per documentation i didn't see asNumber.
if below gives empty result, then try without asNumber and see if it works
{{now.format("d").asNumber}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome to the community.
{{#if is a Cloud smart value function, not DC and is for calculation
AI is not a way to go on Jira automation, AI mixes al kind of information on JIra and self bult smart values.
See all on data smart values here; https://confluence.atlassian.com/automation/jira-smart-values-date-and-time-993924864.html
I'm not in to DC so heavily, but check out the smart values via the link in DC automation, AI won't provide the answer.
monthAsText, is not even an option.
To display the name of a month in the future or past, this is the syntax:
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.