I have a Date Time field,
and another field called Notes,
I wanted to ask,
how to do, so that when the Date Time field is filled on the 20th - the end of the month (calendar time), then the Notes field will become mandatory
Thanks a lot in advance
Hi @RIZKY JTUASIKAL ,
With the help of Field Required Validator ( JMWE) and below conditional validation code you will be able to achieve your requirement.
1. Navigate to the required transition and click on validator to add.
2. Select Field Required Validator (JMWE) and select the Notes field in the dropdown.
3. Check the Conditional Validation and add the below code.
!! issue.customfield_10015 && (((issue.customfield_10015 ? new CalendarDate(issue.customfield_10015) : null).getDate() >= 15) && ((issue.customfield_10015 ? new CalendarDate(issue.customfield_10015) : null).getDate() <= 31))
4. In the above code, please replace 10015 with the custom field id of the plan implementation date field.
Please find below a sample screenshot for your reference.
Please try with the above configuration and please let me know how it goes.
Thanks,
Avinash
Hi Mr. @Avinash Bhagawati {Appfire} ,
thank you for providing a detailed answer :)
but when I tried the query given by you earlier, I got an error message like this:
and here is my query:
!! issue.customfield_12611 && (((issue.customfield_12611 ? new CalendarDate(issue.customfield_12611) : null).getDate() >= 15) || ((issue.customfield_12611 ? new CalendarDate(issue.customfield_12611) : null).getDate() <= 31))
_12611 is the field Plan Implementation Date (date time)
and there's something I want to ask, regarding this:
"getDate() >= 15)"
do I need to change 15 to 20 or not?
I truly appreciate your help..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @RIZKY JTUASIKAL ,
Thanks for your response on this.
Please test the code below on sample issue key to see what it returns for further troubleshooting.
issue.customfield_12611
On the below query, yes, you can replace 15 with 20.
and there's something I want to ask, regarding this:
"getDate() >= 15)"do I need to change 15 to 20 or not?
Thanks,
Avinash
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.
Thanks, @RIZKY JTUASIKAL , that helps here.
You use the Date time picker field instead of a Date picker field. Above provided code works for only the Date Field type.
Please find below the code for the Date time picker field.
!! issue.customfield_12611 && ( new Date(issue.customfield_12611).toCalendarDate().getDate() >= 20 && new Date(issue.customfield_12611).toCalendarDate().getDate() <= 31)
Please try with the above code and please let me know if you have any additional questions.
Thanks,
Avinash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mr. @Avinash Bhagawati {Appfire} ,
I'm sorry, yesterday was our day off...
and today, just able to test again, and the query you provided works very well. :)
thank you very much for your help, Sir..
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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.