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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Use JQL to retrieve last created issue in relation to component

I'm trying to use advanced JQL in order to find the last issue created in a project relating to one or several componentents but I'm struggling to limit the results to the issue that was created last.

project = "project x" and component = "Component y"

Delivers all issues but I only want the Issue that created last, any ideas?

5 answers

1 accepted

0 votes
Answer accepted

This can not be done using JQL

As of 2021, with JIRA automation (JQL and smart values) you can accomplish this, see this automation rule.

Something similar has been discussed here. Have a read of Jobin's answer:

https://answers.atlassian.com/questions/20653/jql-project-dnatest-and-rownum-10-how-to-use-rownum

There isn't a JQL function to do it but if you use the REST API, you can restrict the number of issues returned.

Other than that, you would "order by created DESC" to get the last one created at the top of the results

Thanks, am using the on demand version so REST wouldn't be an option. That aside I was looking for a way to create something like a "monitor" were I'd ask a somewhat more complex question than the one stated in my example above.

project = "project x" AND component in ("Component y","Component Z","Component x")

and then only display the last issue created for each component but maybe it can't be done....

You might want to check, you should be able to use REST for Jira onDemand.

https://answers.atlassian.com/questions/34495/rest-api-for-ondemand

and

https://confluence.atlassian.com/pages/viewpage.action?pageId=253231624

But I think you're right in that there is no way to do what you want in JQL in onDemand.

I would add an order by clause either on created or the key to bring the latest entry to the top of the list. At least the issue you are looking for would be the first one listed.

order by created desc

You are right about REST API, i will check it out.

sir , i am a very much fresher using JIRA and confluence . i am also doing similar work where i need to make sure that " ALL THE ISSUES CREATED IN JIRA SHOULD HAVE jira project COMPONENTS ASSIGHNED TO IT AND THERE WILL BE ONE PAGE WHERE PEOPLE CAN SEE WHAT ARE THE ISSUES GOING FOR A PERTICULAR COMPONENT . whEN ANY ONE CRAETE NEW ISSUE THIS PAGE WILL ATOMATICALLY SHOW THIS ISSUE UNDER RELATED PROJECT COMPONENT " any help will be much appriciated .

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you