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
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.
That result implies customfield_16609 is a number field, and not a text field.
Are you certain you tried this expression using it as a number:
{{issue.customfield_14329.minusDays(issue.customfield_16609)}}
Are you certain customfield_14329 is a date (or date / time) picker field? If not, let's try this to convert from a text-based date to a date type first:
{{issue.customfield_14329.toDate.minusDays(issue.customfield_16609)}}
I also know that some date fields are treated as text when they reach an automation rule's smart values, and so the toDate conversion is needed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I am sure... but doesn't work : no results for this 2 :
{{issue.customfield_14329.toDate.minusDays(issue.customfield_16609)}}{{issue.customfield_14329.minusDays(issue.customfield_16609)}}
but when i put a number it's work : {{issue.customfield_14329.minusDays(3)}}
with log
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for testing, and it appears the defect I noted earlier also applies to the date / time functions. You could confirm that by contacting the Atlassian Support team for their input.
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.