Hi
Using Jira cloud automation, I am trying to find out the days difference between a value in jira field to the hardcoded date value divided by 14.
Documentation only provides use cases that find the difference between now and date value in Jira field.
{{#=}}{{now.diff(issue.Expected Date).days}} / 14 {{/}}
I am trying to find something like below
{{#=}}{{(08/01/2020).diff(issue.Expected Date).days}} / 14 {{/}}
Please can you help how to get the above working?
Hello @Manohar Kurapati ,
If I understand correctly, you are using automation for Jira Sofware Cloud and you are referring to the below documentation pages:
If that's the case, then a quick way to proceed would be to:
{{#=}}{{issue.HardCodedDate.diff(issue.Expected Date).days}} / 14 {{/}}
I hope this helps.
Cheers,
Dario
@Dario B , I have a point here.
The example of @Manohar Kurapati is looking for ".days". If the difference between the two dates does not complete a day, is the result 0 (zero) or something like 0.5 days?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Dionei Piazza ,
Sorry for late reply, I am afraid I have missed your comment. However, even if I have never encountered this scenario myself the assumption is that it returns 0.
Also, looking at the example in the documentation (quoted below) I assume that using prettyPrint the function will return the amount of hours as well:
displays the difference in words, e.g.: 2 days 3 hours.
Please let me know if this is something that you still need to know so that, in case it is, I can ask the Automation team for clarifications.
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have asked the automation team and I have been told that it actually depends on the kind of fields:
yes it should display in hours. If both fields are date time fields. If they are just date fields (no time information) then it will likely be 0.
I hope this helps
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 are very welcome @Dionei Piazza ! :)
Also, as an advice for the future, you have bigger chances to get a quick reply if you create a new question, instead of adding the question to a thread that is older than couple of months (unless it is an active thread).
Cheers,
Dario
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.