This question is in reference to Atlassian Documentation: Managing versions
Ask your question here...
You need to write a groovy script or behaviour script to do this
Thanks for the Answer. I will try~
Hi @Sachin Dhamale I'm kind of stuck in the similar situation. I have to set the default fix version value. I have written the below groovy script in behaviours but seems like this works only for single select field and since fix version field is multi select it is not working (or at least that's what I'm thinking). Can you please help me out on this script?
import com.atlassian.jira.component.ComponentAccessorimport com.onresolve.jira.groovy.user.FieldBehavioursimport com.onresolve.jira.groovy.user.FormFieldimport static com.atlassian.jira.issue.IssueFieldConstants.*if (getActionName() != "Create Issue") {return // not the initial action, so don't set default values}FormField fixVersionId = getFieldById("fixVersions")def fixVersion = "Production - Maintenance"fixVersionId.setFormValue(fixVersion)
Above code works if I change "fix version" field to "assignee" field like below
import com.atlassian.jira.component.ComponentAccessorimport com.onresolve.jira.groovy.user.FieldBehavioursimport com.onresolve.jira.groovy.user.FormFieldimport static com.atlassian.jira.issue.IssueFieldConstants.*if (getActionName() != "Create Issue") {return // not the initial action, so don't set default values}def assignee = getFieldById(ASSIGNEE)def assigneeValue = "admin"assignee.setFormValue(assigneeValue)
TIA.
import com.atlassian.jira.component.ComponentAccessorimport com.onresolve.jira.groovy.user.FieldBehavioursimport com.onresolve.jira.groovy.user.FormFieldimport static com.atlassian.jira.issue.IssueFieldConstants.*if (getActionName() != "Create Issue") {return }FormField fixVersionId = getFieldById("fixVersions")def fixVersion = "Production - Maintenance"fixVersionId.setFormValue(fixVersion)
import com.atlassian.jira.component.ComponentAccessorimport com.onresolve.jira.groovy.user.FieldBehavioursimport com.onresolve.jira.groovy.user.FormFieldimport static com.atlassian.jira.issue.IssueFieldConstants.*if (getActionName() != "Create Issue") {return }def assignee = getFieldById(ASSIGNEE)def assigneeValue = "admin"assignee.setFormValue(assigneeValue)
It looks like you're new here. Sign in or register to get started.