Hi!
In our case we need to compare two dates in creation stage, and if due date = 2 days or less, make reason field required.
In my imagination with simple script validation is ugly, but seem like this:
if (issue.dueDate) { if (issue.dueDate.<=2(Calendar.getInstance().getTime())) { cf (1000) is required
Please help me to sort out.
Thanks!
something like this:
import java.util.concurrent.TimeUnit def twoDaysFromNow = new Date(new Date().time + TimeUnit.DAYS.toMillis(2)) if (issue.dueDate && issue.dueDate.before(twoDaysFromNow)) { return cfValues["Reason"] as boolean }
Hi Jamie! I test it: If i fill any Due the Reason field is required always. And if i fill in Reason field Jira is continue ask me to fill it again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I didnt' test it and made a typo, I've changed it now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, Jamie thank you! I Checked it again, but problem still actual: "Reason" field is required (always).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this is simlpe scripted validator? Add a new line at the end: true
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.
Hi, I am trying following code.please let me know if it wrong. import java.util.concurrent.TimeUnit def today = new Date() if (today == issue.issue.fixVersions*.releaseDate) { return cfValues["RCT Late Approval"] as boolean } Thank you so much in advance....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suresh, import java.util.concurrent.TimeUnit def today = new Date() if (today == issue.issue.fixVersions*.releaseDate) { return cfValues["RCT Late Approval"] as boolean } true
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jamie Echlin [Adaptavist]
Hi Jamie!
May be you know why script is does not work in production environment, but work fine on test environment.
Addon Version is same.
JIRA version is same.
Fields naming is same.
May be import java.util.concurrent.TimeUnit does not work?
When reason field is filled JIRA still ask me to fill it again.
Please help us!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie!
May be you know why script is does not work in production environment, but work fine on test environment.
Addon Version is same.
JIRA version is same.
Fields naming is same.
Please help us!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you solve this? There's no reason it shouldn't work afaik.
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.