Hello All,
My question is, how to search/get all the linked issues with the same title and different issue type in one issue?
Thanks in advance,
Sahish
Hi
Here is a short script you can try in the Scriptrunner console that will return the list of issues linked to issue ABC-1 where the Summary and Issue Types are the same.
import com.atlassian.jira.component.ComponentAccessor
def currentUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def issue = ComponentAccessor.issueManager.getIssueObject('ABC-1')
def links = ComponentAccessor.issueLinkManager.getLinkCollection(issue, currentUser)
if(!links){
log.warn "There are no issue links on $issue.key"
return null
}
def filteredLinkedIssues = links.allIssues.findAll{it.summary == issue.summary && it.issueType == issue.issueType}
if(!filteredLinkedIssues) {
log.warn "There are no issues linked to $issue.key where the Issue Type is $issue.issueType.name and Summary is '$issue.summary'"
return null
}
log.info "${filteredLinkedIssues*.key} are linked to $issue.key and have the same Summary and Issue Type"
return filteredLinkedIssues*.key
Hi @PD Sheehan ,
Thanks for the solution. It worked for me. But in my case both summary and issue type is different. In this case, may I know how to approach this?
Thanks in advance,
Sahish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Then I don't think I understand your case.
Your question was:
how to search/get all the linked issues with the same title and type in one issue
Can you expand on what you are trying to do that is not searching amongst linked issues for an issue with the same title and type?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @PD Sheehan ,
My requirement is like - I have an issue type Release, when one custom field updates in Release workflow, automatically one issue will create, this ticket issue type is "Add Project" so basically both are different types of issue types.
Thanks,
Sahish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So then what's your question?
I showed you how you can access all issues linked to the current/known issue.
From there, you can filter or not on any aspect of an issue.
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.