Hello! i need change duedate field, if user are administator. Next sript woring, but it not work in Russian version.
import com.atlassian.jira.component.ComponentAccessor
if(!getActionName()?.startsWith("Create"))
{
return
}
// define current user
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def duedateField = getFieldById("duedate")
if( user.name == "admin" || user.name == "sysadmin" )
{
def targetDate = new Date() + 365
duedateField.setFormValue(targetDate.format("dd/MMM/yy"))
}
For EN/UK localies a code targetDate.format("dd/MMM/yy") is correct. on the RU locale i get error about format dd/MMM/yy, where i need use d/MMM/yy (one 'd').