Query Jira for Status Change within one hour - jira

I need to query Jira for Issues put "In Progress" with in an hour of time of creation.
Any help will be appreciated.

According to the latest JIRA API docs, there's a search api for use with JIRA. Here is a link to the docs:
http://docs.atlassian.com/jira/REST/latest/#id161575
This link shows details of how to issue a JQL query against the search api.
JIRA JQL searching by date - is there a way of getting Today() (Date) instead of Now() (DateTime)

status = "In Progress" AND created < '1d'
I hope this can help you. If you wanted to see recent, simply as follow:
status = "In Progress" AND created < '1d' ORDER BY created DESC

Related

JQL to Identify Time Logged by Individual

Good morning! I've come across a few answers but maybe there's an update. Is there a way to query the time logged by a specific user in Jira? I've tried
worklogauthor() = {user}
but the resulting Time Spent field brings back all the time logged, not just the time logged by the specific user entered.
Any ideas? I know there are add-ons with this information but if there's a way to get the same information through JQL and a dashboard gadget, that would be the preference - thanks!
Please try following JQL
issuefunction in workLogged("by username")
It can be filtered additionally by adding after date:
issuefunction in workLogged("by username after 2021/12/01")
or even narrowing it to specific period (before date)
issuefunction in workLogged("by username after 2021/12/01 before 2022/01/01")

JQL : show last updated tickets but not by me

In JIRA I would like to show the last updated tickets (ORDER BY updated DESC) that were updated by someone that isn't me (filter).
Is there a way to do it?
Thanks in advance.
There no way to do this with JQL. Only update date is stored.
The closest you can get is using "was" which can be used with status changes or resolution, for example to query something like: status was closed by bob
If you use scriptrunner you also get a similar function for comments: issueFunction in commented("after -4w by jbloggs")
And for work logged: issueFunction in workLogged(on "2015/07/28" by admin)
But probably this would be the closest to what you are looking for:
lastUpdated (by / inRole / inGroup) Finds issues by the user who last
updated them. Example, find all issues that were last updated by
members of the Developers role:
issueFunction in lastUpdated('inRole Administrators')
Hope it helps you

JIRA JQL - Find issues with more than X days in Status

I want to show all issues where it has been in a current status for more than X days - is this possible?
We have this workflow: Registered => Analyze => Planned ... etc. The ticket can be in Registered for 3 weeks and it can be 3 weeks in Analyze without any problems.
Currently I am using this JQL to show tickets that have been more than 3 weeks in Analyze:
project = MyProject AND status = Analyze AND created <= -6w
This is wrong due to so many reasons and it does not look at the time in the current transition state - nor does it take in to account that it can be pushed back from Planned to Analyze and then allow a new 3 weeks analyze period.
Is the above possible to filter in JIRA? I don't have the possibility to use the JIRA REST interface - only the builtin JQL.
I am running with JIRA version 6.4.5.
You should be able to get there using the JQL CHANGED operator. Its documentation is available here.
Your query would look something like this:
project = MyProject AND status = Analyze AND status CHANGED BEFORE -3w
If you want to know for what day range the issue was lying in a status and when status are consecutive, for example a UX review will happen before QA starts working on it and I want to know the issues which are lying in UX review for more than10 days then my JQL can be
project = *your project* AND status changed to "Ux review" before startOfDay(-10) AND status changed from "UX Review" to "Ready to test" after startOfDay()
project = MyProject AND status = Analyze and not status changed during (-xd,now())
With Script Runner plugin I'd create a new scripted field that would just return the number of days since the last status change, with a Number field template, and Number Range Searcher. The
def items = com.atlassian.jira.component.ComponentAccessor.changeHistoryManager.getAllChangeItems(issue).findAll{it.field=="status"}
will return ChangeHistoryItems for Status field. Take the last one and use its getCreated() to find Timestamp. If the list is empty, it means that the issue is in the first step of the workflow, use its issue.getCreated(). Test. Re-index. Search. Use.

How do I query Jira to search for all issues in a project for which no user has logged work in last week?

I need a way to get all the issues (which are not resolved or closed) of a particular project for which no user has logged work in last week.
For example, let's say I have a project = 'abc' with five issues 'i1', 'i2', 'i3', 'i4' and 'i5' and there are two users 'u1' and 'u2' who can log work in these issues.
Last week - 'u1' logged work in issues 'i2' and 'u2' logged work in issues 'i2' and 'i3'.
So the desired result is - 'i1' and 'i4'.
Something like
project = ABC and status not in (Resolved, Closed) and worklogDate > startOfDay(-7)
should work.
You can do this by installing the Script Runner plugin and using JQL to query for workLogged information:
project=ABC and status not in (Resolved, Closed) and issuefunction not in worklogged("after -7d")
If you need to do fancier queries based on the attributes of the users and so forth, see the commented() documentation for reference.

Issues commented by me in JIRA

As per JIRA documentation
http://www.atlassian.com/software/jira/docs/latest
The following filter will show the issues opned by me (Current User).
reporter = currentUser()
Is there a filer that will show issues commented by me? something like the following does not work...
comment by = currentUser()
if you know the name of the user (lets assume the name is Tom you can do:
issueFunction in commented("by Tom")
you can also filter it by date of the comment like:
issueFunction in commented("after -1d by Tom")
UPDATE: this requires ScriptRunner being installed in JIRA server (as JBert pointed out)
You can use the Activity Stream gadget with a filter configured by username and activity type. Note that this requires a case-sensitive username, not the friendly Display Name.
Activity Stream gadget configuration:
Filtered Activity Stream display:
(I posted a variation of this answer elsewhere but have improved my filter since then and the new filter is more salient to this question anyhow.)
You could also follow the approach presented by Matt Doar:
Use a participants field from the JIRA Toolkit plugin and query that
http://confluence.atlassian.com/display/JIRA/Advanced+Searching?focusedCommentId=229838922#comment-229838922
It's not a a complete answer but maybe a step in the right direction...
Francis
I had the same problem and
issueFunction in commented("by username")
worked for me
The following query identifies tickets in which current (or some other particular) user was mentioned in comments:
comment ~ currentUser()
The new scriptrunner can do lots of things e.g. find issues with comments issueFunction in hasComments(), find issues with comments that are not older than 7 days issueFunction in commented("after -7d") and also issue comments from users or groups.
Details can be found here:
https://jamieechlin.atlassian.net/wiki/display/GRV/Scripted+JQL+Functions#ScriptedJQLFunctions-commented(commentquery)
You can try that workaround I am current using this expression on my saved search:
comment ~ "your.username.here"
This in fact catch the comments where I was mentioned, but if you mention yourself probably should works. I have not tried by myself.
My current Jira is a cloud based one, so I can't tell you exactly which version is.
In JIRA v7.3.0, the watcher field works well, if autowatch is enabled:
watcher = currentUser()
How to enable
Profile > Preferences > Autowatch : [inhert, disabled, enabled]
Issues that you create or comment on will automatically be watched for future changes.
For filtering issues in which you have been mentioned, try comment ~ currentUser()
This (to my knowledge) cannot be completed using JQL, even with a plugin. If you have DB access, the query is simple:
SELECT pkey, summary FROM jiraissue, jiraaction WHERE jiraissue.id = jiraaction.issueid AND author = '<insert_jira_username>';
If you're talking only about the current user, there is a personal Activity Stream in your profile
https://xxx.atlassian.net/secure/ViewProfile.jspa
It includes actions other than comments, but does provide an RSS feed which you could filter only comments with:
<category term="comment"/>
This is the query to know the issues I am involved in:
SELECT a.pkey, a.summary FROM jiraissue AS a left join jiraaction AS b on a.id = b.issueid
where b.author = 'jira_username' OR a.REPORTER = 'jira_username' OR a.ASSIGNEE = 'jira_username'
group by a.pkey order by a.CREATED
This is the query to know all issues raised in the last 24 hours.
select REPORTER, SUMMARY from jiraissue
WHERE CREATED > DATE_SUB(CURDATE(), INTERVAL 1 DAY) order by CREATED DESC;

Resources