Skip to content

Instantly share code, notes, and snippets.

@vikrantyadav11
Created April 27, 2021 05:47
Show Gist options
  • Save vikrantyadav11/5b9154eac0d5e8c2d06f83a02831f8f1 to your computer and use it in GitHub Desktop.
Save vikrantyadav11/5b9154eac0d5e8c2d06f83a02831f8f1 to your computer and use it in GitHub Desktop.
Restrict System priority field values using Script Runner behaviour
import com.atlassian.jira.component.ComponentAccessor
import static com.atlassian.jira.issue.IssueFieldConstants.*
def formField = getFieldById(PRIORITY)
def optionsMap = ComponentAccessor.getConstantsManager().getPriorities().findAll { priority ->
priority.getName() in ["Major", "Minor", "Trivial"]
}.collectEntries {
[(it.id): it.name]
}
formField.setFieldOptions(optionsMap)
@vikrantyadav11
Copy link
Author

How do you set form field auto fill when, for example have a custom field called Acceptance criteria, so when user open ticket for creation then acceptance criteria get autofill based on Issue Type Story?

@Isranigit

Check this link updating text field based on issue type :- https://gist.github.com/vikrantyadav11/8b8312372bd6487c9758f9c8a1998a95

Replace description with Acceptance Criteria field id for eg : customfield_12345

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment