Hello there,
I have successfully been using the following HTML calculation for a Calulated Number Field via JIRA Misc Custom Fields to return the range between two dates, which are the custom field IDs in this case:
<!-- @@Formula: (issue.get("customfield_11618")==null ? null : (issue.get("customfield_11618").getTime() - issue.get("customfield_11616").getTime()) / 1000 / 3600 / 24) -->
I derived this formula from another forum post on a related topic I saw which was using the following calculation:
<!-- @@Formula: issue.get("resolutiondate")==null ? null : (issue.get("resolutiondate").getTime() - issue.get("created").getTime()) / 1000 / 3600 / 24 -->
I am wondering if it is possible to use as a variable in calculations like these the CURRENT DATE (no time component)? So this would be a variable the value for which would be changing every day. Is it possible to include such a variable in an HTML calculation like this, and , if so, what is the syntax?
Thank you!
You can use "new Date()" to return a Date object representing NOW. If you want to use it in a formula similar to the one in your example, this will do:
<!-- @@Formula: (issue.get("customfield_11618")==null ? null : (issue.get("customfield_11618").getTime() - (new Date()).getTime()) / 1000 / 3600 / 24) -->
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
is there a way to calculate the last day of a given month? (so if I create the issue today, I would like to have the due date as the last day of this month
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.