Hi everybody,
I need your help please. I am beginner about JIRA
That I wanted :
I have two custom fields :
1) "Date de MEP" as a date (customfield_14329)
2) "Délai avant fin" as alphanumeric (customfield_16609) but this field has only numbers
With Autonomation, I want to substract "Délai avant fin" to "Date de MEP" and put the result in "Actual End" when "Délai avant fin" is changed
I try but doesn't work :
{{issue.customfield_14329.minusDays(("Durée de l'action").asNumber)}}
{{issue.customfield_14329.minusDays(issue.customfield_16609)}}
but
{{issue.customfield_14329.minusDays(3)}} : it's works with 3 but with doesn't work with a custom fields
Can you help me please ? Thank you very much
Hi @TILLENAYAGANE -- Welcome to the Atlassian Community!
In your first expression, the asNumber conversion is at the wrong location. It should be convert the text field to a number for use as a parameter:
{{issue.customfield_14329.minusDays(issue.customfield_16609.asNumber)}}
Kind regards,
Bill
thanks for your help, but it's doesn't work.
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.
First thing, for rules like this where conversion is involved, it helps to use writes to the audit log to check the values: https://confluence.atlassian.com/automation/jira-automation-actions-993924834.html#Jiraautomationactions-logactionLogaction
I recommend adding some writes to the audit log to help diagnose this during testing:
customfield_14329: {{issue.customfield_14329}}
customfield_16609: {{issue.customfield_16609}}
customfield_16609.asNumber: {{issue.customfield_16609.asNumber}}
Next, I found a defect indicating asNumber does not always work with text fields converted to numbers when used in a function call: https://jira.atlassian.com/browse/JIRAAUTOSERVER-1084
Based on another workaround I recall for Jira Data Center, let's try forcing the field to text first and then to a number:
{{issue.customfield_14329.minusDays(issue.customfield_16609.trim().asNumber)}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It's very usefull the audit log (I didn't know before). Thanks a lot
customfield_14329: 2024-12-17T19:45:00.0+0000 (it's my date)
customfield_16609: 9 (it's my alphanumeric custom fields)
but :
"customfield_16609.asNumber" or "issue.customfield_16609.trim().asNumber :" no result
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.