Hi,
I have a Field on issue creation named Start Date. I would like to create a validator that only allows dates to be set not earlier than the 1st day of the current month.
Can I please get some examples?
Cheers,Jason
Hello,
Try like this:
import com.atlassian.jira.component.ComponentAccessorimport java.util.Calendardef issue = ComponentAccessor.getIssueManager().getIssueObject("IM-587166")def cf = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Start Date")Calendar c = Calendar.getInstance(); // this takes current datec.set(Calendar.DAY_OF_MONTH, 1);if (issue.getCutomFieldValue(cf) < c.getTime()) { return true} return false
Hi @Jason Galea,
You can also use Workflow PowerBox add-on to solve it.
There is 2 features you can use:
- Use "Run Condition as a Validator"
- Inside the validator use "Universal Date/Time Condition".
thank you it worked!!
It looks like you're new here. Sign in or register to get started.