I have a similar problem,
1.
on “new issue” or “edit issue” screen, if the field “Priority” is set to either Blocker, the field “Due Date” should be mandatory. Respectively, if the field “Priority” is set to Trivial, Minor, etc., the field “Due Date” should be optional.
2 I add a script liske this"
public void setEnvironmentWhenHighPri () {
FormField priField = getFieldByName("Priority")
FormField dueField = getFieldByName("due date")
if (priField.getFormValue() == "1") { // Blocker priority
dueField.setHelpText("<div class=\"warningBox\">Please explain why priority is Blocker.</div>")
dueField.setRequired(true)
}
else {
dueField.setRequired(false)
}
}
anyone can help me, where is the problem in this script.
I think "due date" should be "duedate". At least log.warn the value of dueField, so you cna see if it's null.
Any errors in the log?
Thanks for your quickly reply, I have updated " FormField dueField = getFieldByName("duedate"), but still does not work, even I updated the condition to " if ("1" == "1")".
Sorry, I didn't find error message about this in log file atlassian-jira.log, do you have any other suggestion about this, thanks again.
Gary
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.