Hi everyone ,
I'm trying to build a JQL that allow me to compare a field between some "causes / is caused by" linked issue.
The goal is:
I can use script runner
I got a ticket named Impact into a specific project, link with some other epic tickets in differen other project by "causes / is caused by" link.
I want to compare the product field and see ticket if the product field is different between linked issue.
I try many option but i never get something that match the prerequisite.
Ok JQL seems not what i want (or i can't find the solution in JQL)
So now i'm tryin to do it in console script
(actually i just have the process idea )
projectKey= ...
linkTypeID= ...
customFieldId = ...
Iterate on all issue of $projectKey{
if (projectKeyIssue.link)
print table with projectKeyIssue .name / .link / .customfieldId.value
iterate the linkedIssue
if(projectKeyIssue.customFieldId.value!= linkedIssue.customFieldId.value)
print table with linkedIssue .name / .link / .customfieldId.value
If someone has ever try to do something like that or have some snippets i can use i'm very interrested !
Meanwhile i'll try by myself !
My Thanks in advance
Hi @fperez
Did you figure it out? I was going to answer before but this question got lost on my browser tabs.
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.
@fperez
You can try to run this first, just to see if this is what you need
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.web.bean.PagerFilter
import com.atlassian.jira.user.util.UserManager
import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.query.Query
import com.atlassian.jira.issue.link.IssueLink
import com.atlassian.jira.issue.IssueLink
import com.atlassian.jira.issue.IssueManager
def projectKey = "TEST"
def linkType = "Relates"
def customFieldName = "test"
def customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName(customFieldName)
//JQL to run
def queryJql = "project = "+projectKey
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def searchResult = ComponentAccessor.getComponent(SearchService).search(user,queryJql,PagerFilter.getUnlimitedFilter())
//It should log the total results after running the jql
log.warn searchResult.total
//This will iterate all the results in your jql . issueTemp is each issue result.
//It will search for every linked issue type. Just to see if it's working.
searchResult.getResults().each{ issueTemp ->
List<IssueLink> allInIssueLink = ComponentAccessor.getIssueLinkManager().getInwardLinks(issueTemp.getId())
def linkedIssue
def parentCustom = issueTemp.getCustomFieldValue(customField)
for(Iterator<IssueLink> inIterator = allInIssueLink.iterator();
inIterator.hasNext();){
IssueLink issueLink = (IssueLink) inIterator.next();
linkedIssue = issueLink.getSourceObject()
def childCustom = linkedIssue.getCustomFieldValue(customField)
if(parentCustom==childCustom){
log.warn issueLink.getIssueLinkType().getName() + "-" + linkedIssue.getKey()
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey, still looking for the solution :
i tryed something like that :
(issueFunction in linkedIssuesOf("issue=RDVAD-896") AND type = Epic ) OR (issue = "RDVAD-896" AND type = Impact)
but i would like some automatisation , not having to put the issue and do this for all the isse of a projet AND showing just the issue where field of the issue don't match with the same field of the linked issue.
It should be easy but it seems not to be ...
Still open to solution with scritrunner too
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.