Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I write an inner join query in JCL based on the comparison of custom variable

Barry Mazin June 12, 2024

I have a custom variable called Assigned Team.  I want to write a  jira query that limits the results to only when Assigned Team is not equal to itself for a particular linked dependency.

 

Here is my starting point. This will provide me with the stories and bugs for each of the teams that have a particular inner dependency of "is Blocked by" and "dependent on".  How to I create the join to combine this list with the issue's outer dependencies but not include those where the assigned teams from the joins is equal,

"Assigned Team" in ("Team1", "Team2", "Team 3") AND issueLinkType in ("is blocked by", "Dependent On") and Status not in (closed, "Pending Release") AND issuetype in (Bug, Story)

 

 

 

1 answer

0 votes
Nikki Harris
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 12, 2024

Hello

 

To achieve this, you can use a JQL query with the appropriate syntax to exclude results where the Assigned Team is equal to the assigned team of linked issues. Unfortunately, JQL does not support direct comparison between fields of linked issues out of the box. You would typically need to use an add-on like ScriptRunner for advanced JQL functions.

Here is a simplified starting point using basic JQL:

```
"Assigned Team" in ("Team1", "Team2", "Team 3")
AND issueLinkType in ("is blocked by", "Dependent On")
AND status not in (closed, "Pending Release")
AND issuetype in (Bug, Story)
AND issueFunction in linkedIssuesOf("project = YOURPROJECT and 'Assigned Team' != 'Team1'", "is blocked by")
```

You would need to adjust the `linkedIssuesOf` function to match your specific conditions. Note that this example assumes you have an add-on like ScriptRunner installed. If you do not have access to such add-ons, you might need to handle this logic outside of JQL, such as via a script or reporting tool.

 

Regards

Nikki Harris

Provident Botanico

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events