How to associate an existing Component in Jira to an issue while creating the issue programatically using IssueInputParameters?
Hi @Dhruv Dixit ,
I believe you can use method setComponentIds(Long... componentIds).
Is it possible to share your code with me? Then I will be able to help you better.
Thank you.
Can we map the issue to an existing Component using Components names?
Is there some method like setComponentNames(String componentNames)?
If yes, could you please share the link to the documentation for the method?
Or else, could we somehow get the name of the component from Component ID?
Thanks in advance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dhruv Dixit ,
there no such method like setCompontNames.
But you can get component using it's name and then obtain component id from the found object:
import com.atlassian.jira.bc.project.component.ProjectComponent
import com.atlassian.jira.bc.project.component.ProjectComponentManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.project.Project
MutableIssue issue = issue
Project project = issue.getProjectObject()
ProjectComponentManager projectComponentManager = ComponentAccessor.getProjectComponentManager()
ProjectComponent component = projectComponentManager.findByComponentName(project.getId(), "Name")
if (component) {
Long componentId = component.getId()
// continue ...
}
If you please share your code, I can help you finish it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.