I have a confiform that I'm trying to add css rules to some fields. I'm having trouble getting the expression correct to make it work.
I have 6 date fields:
- initial start (initStartDate)
- initial end date (initEndDate)
- Option 1 Start Date (opt1StartDate)
- Option 1 End Date (opt1EndDate)
- Option 2 Start Date (opt2StartDate)
- Option 2 End Date (opt2EndDate)
I'm trying to achieve three filters for css rules based on the initEndDate field.
1. if opt1StartDate AND opt2StartDate are empty AND initEndDate is greater than 180 days from Today, then background colour should be green.
2. if opt1StartDate AND opt2StartDate are empty AND initEndDate is less than 180 days from Today, then background colour should be orange
3. if opt1StartDate AND opt2StartDate are empty AND initEndDate is less than or equal to today then background colour should be red
I've tried the following approaches trying both timestamp and number of day values but haven't gotten it right yet. I believe from the docs that datetime intervals need to be done in milliseconds, but unsure if this is also the case for date values.
opt1StartDate:[empty] AND opt2StartDate:[empty] AND initEndDate.subtract(_today):>180
opt1StartDate:[empty] AND opt2StartDate:[empty] AND initEndDate.subtract(_today):>15552000000
opt1StartDate:[empty] AND opt2StartDate:[empty] AND ([entry.initEndDate]-_today):>180
Appreciate any help to identify the issue.
Thanks
Drew
Hi @Drew T
Try the following
opt1StartDate:[empty] AND opt2StartDate:[empty] AND initEndDate:>[today]+180
or
opt1StartDate:[empty] AND opt2StartDate:[empty] AND initEndDate.substract(15552000000):>[entry._now]
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alex Medved _ConfiForms_ Any reason why none of these work? every date displays error.
Due is date field, formatted to yyyy-MM-dd
‘ConfiForms Rules for Field Definition w/ condition !due[empty]
Validation Rule
due:>([entry.due.timestamp] +1209600000
)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to define that in the condition, in addition to what you already have
For example
!due:[empty] AND due:>[today]+14
or
!due:[empty] AND due:>([entry._today.add(1209600000)])
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No such luck with either.
Seems to be a bigger issues, as the value is way off.
due in the ConfiForms Field Definition’ Macro is a Date field type, since this is linked to the due date in Jira for issue creation.
Tried selecting 2/2/24
Can I just use the validation rule section in the ConfiForms Field Definition, or do I have to add ConfiForms Rules for Field Definition’ Macro as well?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I try just a condition in ConfiForms Rules for Field Definition and no validations it lets all entries go through, even if i pick tomorrow.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please open a support ticket with us. I recall there was a regression with a validation in few minor versions just recently. Might be related to this (has been fixed some time ago)
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.