Hi
I want to set the Priority to Major when the below condition is true, I have used "set field value (JMWE for jira server)", but it not setting to Major. Could you please anyone correct the equal script ?
(issue.getAsString("Issue Type") == "Change Request" || issue.getAsString("Issue Type") =="Bug" ) && issue.get("Need By Date") == new Date()
or
(issue.getAsString("Issue Type") == "Change Request" || issue.getAsString("Issue Type") =="Bug" ) && issue.get("Need By Date").equals(new Date())
but these are working,
(issue.getAsString("Issue Type") == "Change Request" || issue.getAsString("Issue Type") =="Bug" ) && issue.get("Need By Date").before( new Date() )
and
(issue.getAsString("Issue Type") == "Change Request" || issue.getAsString("Issue Type") =="Bug" ) && issue.get("Need By Date").after( new Date() )
Hi,
that's because Date objects contain both a date and a time component, so new Date() returns "now", not just "today". To return "today", use:
new Date().clearTime()
Thank you for your quick response @David Fischer . Its working.
(issue.getAsString("Issue Type") == "Change Request" || issue.getAsString("Issue Type") =="Bug" ) && issue.get("Need By Date").equals(new Date().clearTime())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The same scenario, but i have to add the project name as script here.
Ex: Project ABC and Project XYZ and Issutype stories. But i want to implement this only for project ABC bugs not for project XYZ.
Thanks in advance.
Best,
Ganesh.
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.