Compare two fields with custom JQL
Problem
You need to create a custom JQL to find issues where two specified fields do not match. Specifically, you want to identify issues where a custom field does not have the same value as the corresponding epic.
Solution
Use a custom SIL script that compares field values between epics and their linked stories. The script takes two parameters:
A JQL query that returns a list of epics;
The name of the custom field to compare.
The script identifies issues where the custom field (second parameter) does not have the same value as the corresponding epic.
Script
string [] epics = selectIssues(argv[0]);
string matchField = argv[1];
string [] ret;
for(string e in epics) {
for(string i in allLinkedIssues(e, "Epic-Story Link")) {
if(%i%.%matchField% != %e%.%matchField%) {
ret += i;
}
}
}
return ret;Implementation steps
Create the SIL script using the code above.
Save the script as
silJql_FieldValueDosentMatchEpic.silor another name.Use the script in JQL queries by calling it with the appropriate parameters.
Example usage
This JQL query finds all stories in project EX where the Team field doesn't match the Team field of their parent epic.
key in silJQLList("silJql_FieldValueDosentMatchEpic.sil", "Project = EX and type = Epic", "Team")The filename in the JQL query ("silJql_FieldValueDosentMatchEpic.sil") must match the exact name you used when saving the SIL script in the previous step.
Parameters
First parameter: JQL query to select epics (
"Project = EX and type = Epic").Second parameter: Name of the custom field to compare (
"Team").
Need support? Create a request with our support team.
Copyright © 2005 - 2025 Appfire | All rights reserved.
