Trying to write a groovy script behavior for a custom field "ETA" whenever a fix version changes (i.e retargeted)
Snippet:
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.project.version.Version
import org.apache.log4j.Level
import org.apache.log4j.Logger
import com.onresolve.jira.groovy.user.FormField
import java.sql.Timestamp;
import java.util.Date;
import java.text.SimpleDateFormat;
def log = Logger.getLogger("Bug retarget clears ETA")
log.setLevel(Level.DEBUG)
//from Satya
//def issueid = formContents["id"]
//log.debug(String.format("bbb issueid is %s", Objects.toString(issueid)))
def eta = getFieldByName("ETA")
def eta_value = eta.getValue() as Date
log.debug("**===============**")
log.debug(String.format("ETA value before: %s", eta_value))
>>>> This is not showing the ETA date of the jira ticket being updated... gives a "null"
And then,
after checking if fixversion has changed.... want to make it a null string as below
eta_value.setFormValue(null)
Groovy script complains that "unknown parameter type"
Can you help solve this issue
Configure your behaviour on the Fix Versions field. If you do this your script will execute every time that field changes. Then in the script you can clear the ETA field.
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.