Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

how to set default version for "fix version"

This question is in reference to Atlassian Documentation: Managing versions

Ask your question here...

1 answer

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.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.

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.

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.

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 

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you