As the title says, I want to auto fill a defaule component when create a issue. Can JIRA or some plugin can do this? I have searched for some old questions about this title, the answers are all negative. Is there some more achievements?
I would also like to know if this is possible. Its seems that you can only set default values on custom fields.
You could try this, though it is not a perfect solution...
https://community.atlassian.com/t5/Questions/How-do-I-update-component-field-using-post-functions-in-a/qaq-p/134943#M14366
Hi,
See my answer here https://community.atlassian.com/t5/Adaptavist-questions/Set-default-value-to-component/qaq-p/1089550
Using a scriptrunner Behavior, I was able to assign a default component.
---
import com.atlassian.jira.component.ComponentAccessor
import static com.atlassian.jira.issue.IssueFieldConstants.*
// set Componentsdef projectComponentManager = ComponentAccessor.getProjectComponentManager()def components = projectComponentManager.findAllForProject(issueContext.projectObject.id)def component = getFieldById(COMPONENTS)if (! component.getValue()) {component.setFormValue(components.findAll { it.name in ["Component name from the list"] }*.id)}
You can also assign multiple components by changing the ["Component name from the list"] to ["Component name from the list", "Other component name"]
Hello,
Try this as post-function:
import com.atlassian.jira.component.ComponentAccessordef projectComponentManager = ComponentAccessor.getProjectComponentManager()projectComponentManager.findAllForProject(issue.projectObject.id)def component = projectComponentManager.findByComponentName(issue.projectObject.id, "YOUR COMPONENT HERE")issue.setComponent([component])
this worked for me, thanks
It looks like you're new here. Sign in or register to get started.