You need to write a groovy script or behaviour script to do this
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.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import 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.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import 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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import static com.atlassian.jira.issue.IssueFieldConstants.*
if (getActionName() != "Create Issue") {
return
}
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.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import static com.atlassian.jira.issue.IssueFieldConstants.*
if (getActionName() != "Create Issue") {
return
}
def assignee = getFieldById(ASSIGNEE)
def assigneeValue = "admin"
assignee.setFormValue(assigneeValue)
TIA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import static com.atlassian.jira.issue.IssueFieldConstants.*
if (getActionName() != "Create Issue") {
return
}
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.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import static com.atlassian.jira.issue.IssueFieldConstants.*
if (getActionName() != "Create Issue") {
return
}
def assignee = getFieldById(ASSIGNEE)
def assigneeValue = "admin"
assignee.setFormValue(assigneeValue)
TIA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nishant V ,
Need help regarding the "Fix Version/s" field
In the issue edit screen, I want to display only "Unreleased" versions. Released Versions shouldn't be displayed in the Fix Versions field.
Regards,
Prasad
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.