Good afternoon all!!
I am trying to find out how to calculate the difference betwen two dates field and use the result to set another field number data type using JMWE set fields post function
Does anybody know how to do it?
Thanks in advance
Ro
On Jira Cloud, you can use the date('diff') Nunjucks filter, as described here: https://innovalog.atlassian.net/wiki/spaces/JMWEC/pages/108200221/date+filter#datefilter-Datecalculations
For example:
{{ issue.fields["End Date"] | date('diff', issue.fields["Start Date"], 'days') }}
Thank you David! I didn't know how to used that filters! it worked!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
Even i am looking for the same field to calculate the difference between two dates in my Jira ( Data Center) we have a addon like Xray & JMWE, Does will work to use above script?
Thanks in advance
Chenna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the syntax is different on Server/DC. You can use the secondsBetween and workdaysBetween global functions, as documented here: https://appfire.atlassian.net/wiki/spaces/JMWE/pages/78055921/Groovy+Variables+and+Functions#secondsBetween(Date-from%2C-Date-to)
For example:
secondsBetween(issue.get("Start Date"), issue.get("End Date"))
which returns a number of seconds, or
secondsBetween(issue.get("Start Date"), issue.get("End Date")) / 86400
to return a number of days.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
Thanks for the quick response, i just going thru that above URL and it's mentioned Seconds between (Date,from and date) variable, where do i need to add groovy script in JMWE addon, it could help to provide the steps to use functionality .
Thank You,
Channakesa Chindanur
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It depends on what you're trying to achieve. Where do you need that calculation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
In Jira Data Center! to add a filed using between two value dates as i given below example, This we wanna try in the Jira Issues dash board to get the time spent value field.
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.
Hi David,
We have a one issue type 'text execution' and we need to add one custom filed to add time elapse between two dates on each issue eg: above mentioned image is Begin date and End date in that we want how much time has been spent, think so we don't have a default CF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use the scripted groovy function: https://innovalog.atlassian.net/wiki/spaces/JMWE/pages/68878434/Workflow+Post-functions
You just then follow an example like this one: https://community.atlassian.com/t5/Jira-questions/Calculate-number-of-days-between-startDate-date-custom-field-and/qaq-p/676579
Regards
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.
In that case you may have to play with the other scripted function. https://innovalog.atlassian.net/wiki/spaces/JMWEC/pages/1501265949/Build-your-own+scripted+Post-function
I haven't used it myself but there are some examples in the links.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you all!! I tried the solution @David Fischer suggested and it worked. I am still learning to use JMWE
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.