Do Custom Fields, Target Start, need to be converted to jqlDate before using in Variable?

Michael Ayers April 4, 2024

Cannot find an answer researching this.  I have a manually triggered automation that runs successfully but does not put anything into TEXT 1 field.  Below is what i have:

top.pngbottom.png

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 4, 2024

Hello @Michael Ayers 

Welcome to the Atlassian community.

Please show us the details of the step where you are trying to set the TEXT 1 field.

Michael Ayers April 4, 2024

bottom2.png

Michael Ayers April 4, 2024

before i did not have anything in blank above and now when i put the variable name in the box and run the automation i get this in TEXT 1:

bottom3.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 4, 2024

Hello @Michael Ayers 

I see three problems with the smart value that you are trying to assign to the variable Calculatedays:

  1. You are missing a second curly brace at the front of the smart value (before now).
  2. You need to swap the positions of the abs and days functions.
  3. You are missing a period after 10202) 
Michael Ayers April 5, 2024

GM Trudy....made those changes and rule runs successfully....but nothing returns in TEXT 1 field...it is blank

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 5, 2024

Please show us the changes that you made.

An excellent debugging tool is the Log Action. You can use it to write out to the rule's audit log the values of smart values, variables, and fields, to see what values are actually being used in the rule. I recommend you use that to ensure your smart value is generating the value you expect. You can use it to print out the building blocks of your smart value.

For instance you are using a custom field in your smart value. Print out that field. Print out the value of {{now}}. Print out the value of {{now diff(issue.customfield_#####)}}}, and so on.

Michael Ayers April 12, 2024

Hey @Trudy Claspill 

Made those changes you recommended.  Looks like the rule runs successfully but doesn't return a value in the log and doesn't show in TEXT 1.  Any suggestions?

04112024 Latest.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 12, 2024

Hello @Michael Ayers 

I have so far not been able to reproduce your problem in a Jira Software DC v9.4.11 instance.

When I use the same functions with a Date Picker custom field I get the expected results. I did not have to use the format function.

Screenshot 2024-04-12 at 11.51.00 AM.png

Additional debugging you can try with Log actions is to print segments of your smart values, like I did. See what value you get when you use only the diff function. Then see what value you get when you tack on the abs function.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 12, 2024

Hi @Michael Ayers 

First, I note you have the function abs before the unit of measure days for the diff.  Please try reordering those:

{{now.diff(issue.customfield_10202).days.abs}}

If that does not help...are you certain about the type of your custom field?  Have you tried adding toDate to convert it:

{{now.diff(issue.customfield_10202.toDate).days.abs}}

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer