Hallo Guys,
I need help assigning a value to a number field, comparing 2 field date pickers
field is :
Commitment date (date Picker)
Actual date (date Picker)
project performance by date" (number)
Which help I need :
We compare 2 field value Commitment date and Actual date. If Actual date 1 week more than Commitment date, Project Performance by date value is 10
and I can make same script to make condition Project Performance by date value is 20
Regards,
Tyas
Hi Tyas,
I use post function "Set issue fields" in JMWE. I'm also set it like this picture below
1. Target Issues : Current issue
2. Add Field : Project Performance by date with value
--------------------------------------------------------------------
{% if issue.fields["Actual date"] | date('diff',issue.fields["Commitment date"],'days') == 7 %}
10
{% elif issue.fields["Actual date"] | date('diff',issue.fields["Commitment date"],'days') != 7 %}
20
{% endif %}
--------------------------------------------------------------------
you can adjust the value as you need
For additional information:
- Actual date, Commitment date are date picker
- Project Performance by date is number field
Cheers,
Chrishanditya Wisnu Nirwandha
Hi Adit,
thanks for you respont,
I tried to use your script and the result is Project Performance by date (PP) value 10 if Actual date (AD) 7th day of Commitment Date (CD) and other conditions like 4th or 9th day from actual date, Project Performance by date value 20
the big picture what I need
PP value is 30 if the range of AD and CD = > 21 days
PP value is 20 if the range of AD and CD = > 14-21 days
PP value is 10 if the range of AD and CD = > 7-14 days
Regards,
Tyas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tyas,
You can adjust the value of post function like this script below :
------------------------------------------------------------------------
{% if issue.fields["Actual date"] | date('diff',issue.fields["Commitment date"],'days') >= 7
and issue.fields["Actual date"] | date('diff',issue.fields["Commitment date"],'days') <= 14 %}
10
{% elif issue.fields["Actual date"] | date('diff',issue.fields["Commitment date"],'days') > 14
and issue.fields["Actual date"] | date('diff',issue.fields["Commitment date"],'days') <= 21 %}
20
{% elif issue.fields["Actual date"] | date('diff',issue.fields["Commitment date"],'days') > 21 %}
30
{% endif %}
------------------------------------------------------------------------
you also can use this references :
- https://mozilla.github.io/nunjucks/templating.html#if
- https://mozilla.github.io/nunjucks/templating.html#math
- https://innovalog.atlassian.net/wiki/spaces/JMWEC/pages/141442150/Set+an+Estimate+of+the+issue+to+the+difference+of+two+specific+dates
Cheers,
Chrishanditya Wisnu Nirwandha
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.