Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

JQL query to fetch issues linked to a bug with 'relates to' in order

I am trying to fetch issues linked to a bug in the order of their linking time

ex story-1 story-2 story-3

if story-2 is linked to bug first followed by story-3 and story-1

I want to write a jql query that can fetch me these issues on their order of linking any order either Asc or Des like


issue in linkedIssues({{issue.key}}, "relates to") And issueType = story

I was able to get this far but not able to get them in the order of linking

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 24, 2023

Hello @raghuvarmaofficial 

Native Jira JQL functionality does not support ordering issues based on the date/time that a link was created between two issues. The date the link was created is documented in the history for each issue in the pair. The ORDER BY clause in JQL generally cannot be applied to information that is embedded in issue history. Rather it is used with the issue fields like Status, Created, Components, etc.

Given that you included {{issue.key}} in your JQL I suspect that you are trying to do this within the context of an Automation Rule.  You might be able to find a method accessible within an Automation Rule to parse the history for each retrieved issue and pull out the entry for when the link to the bug was created. I'm afraid I don't have that level of expertise.

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events