Hi,
I am using a Due Date field in my create screen but I am not able to validate it against system date or today's date.
When I use date compare validator and compare Due date with created date it didn't work because while creating a ticket created date is null !!
Thanks !!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just tested Dieter's solution and it worked fine. I made a couple of minor tweaks:
import com.opensymphony.workflow.InvalidInputException if (issue.dueDate) { if (issue.dueDate.before(Calendar.getInstance().getTime())) { invalidInputException = new InvalidInputException("Due date must be in the future.") } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not beyond saying read the documentation. If you're not a technical person and don't want to read up on it you probably need another plugin to be honest.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've have a custom date field "first date". I've modified the script accordingly and placed it at create event however its not validating my first darft date field. It's still accepting past date values. Could you please advice? import com.opensymphony.workflow.InvalidInputException if (issue.First Draft) { if (issue.First Draft.before(Calendar.getInstance().getTime())) { invalidInputException = new InvalidInputException("First date date must be in the future.") } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please replace all occurences of issue.First Draft by cfValues ["First Draft"] Only system fields have getters lije dueDate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i edited my code however it's still the same. import com.opensymphony.workflow.InvalidInputException if (issue.cf[13919]) { if (issue.cf[13919].before(Calendar.getInstance().getTime())) { invalidInputException = new InvalidInputException("date must be in the future.") } }
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.
Please look at https://jamieechlin.atlassian.net/wiki/plugins/servlet/mobile#content/view/1212434 howvto correctly use the map cfValues. issue.cf[fieldid] doesn't work cfValues['name of field'] instead shoukd work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As Dieter said.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would do it in your validator for the Start Progress transition so that your Created date is set. Additionally you won't be able to start progress on a task that has a due date before the created date. This won't require you to use a plugin to get the functionality you are looking for.
However if you want to do it on the Create Issue transition then I would use the JIRA Workflow Enhancer Plugin. Use the Universal Validator on the Create Issue Transition with the following settings:
Expression:
{Due Date} > [now]
Evaluate To:
true
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Ronald. Validating an issue in start progress will nor work for me, since we do not want an issue created with a faulty due date. That option gets ruled out;
Workflow enhancer not available for JIRA 4.0.1 used by us.
Also tried the Date compare with Due date and a custom field that populates current system time for comparision - No Use.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Have the same problem; Since JIRA accepts past dates in Due date field - would like to validate my due date to be equal to or greater than current date. With Date Compare validator - Says, 'Error creating issue: Could not load validator class'.
Any answers on this would be helpful.
Thanks.
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.