Is there any possibility to create a JQL query that can be parameterized with a specific value that can be selected by a user for a dashboard? For example, I wanna show all issues that are linked to a certain issue via a specific link type.
The query I use for links looks like this:
project = Bar and issueFunction in linkedIssuesOfRecursive("project = Foo and key = Foo-123", "relates to")
As you can see, the query itself is not the problem, its rather simple, but the key is hardcoded. Is there any way of creating a dashboard / rich filter, where the user can simply enter a key and the query is executed with that key?
I'm making use of the Jira API with the following call:
https://site.url/rest/api/2/search?jql=project=PROJECT&updated>=startOfWeek(-1w)
When I run this, I'm getting over 6000 results. But when I run the jql query of project = PROJECT AND updated >= startOfWeek(-1w) inside of my Jira sites search bar, I only get around 60 results.
Is there something I'm missing in my api call that would limit the returned to the data to the above query?
Edit
Looking further it appears my call is only bringing back results from my project space and not using the updated query. What should I do so it picks up both?
There is a typo in your query. You have used an ampersand instead of the word 'and'. The ampersand is the character used to add query parameters, so you effectively did this query
https://site.url/rest/api/2/search?jql=project=PROJECT
then Jira just ignored what came after the ampersand, as it didn't know what the parameter 'updated>' was, or how to make it equal 'startOfWeek(-1)'
Within the JQL, you must use the word 'and' with spaces before and after, like this:
https://site.url/rest/api/2/search?jql=project=PROJECT and updated>=startOfWeek(-1w)
Only use ampersands to add other query parameters afterwards, like this:
https://site.url/rest/api/2/search?jql=project=PROJECT and updated>=startOfWeek(-1w)&startAt=0&maxResults=500
Please send the API as POST method:
API: https://url/rest/api/2/search
Body:
{
"jql": "project='project name'&updated>=startOfWeek(-1)"
}
In a given area path, I would to get the list of stories that does not have parent feature link. How should I write the query for it?
To achieve you could change the type of your query to the Work items and Direct Links query, then choose the option to pull back all work items without any matching links. The results will still be a flat list.
In the filters for top level work items, just add a filed to specify a detail area path and choose corresponding work item type.
More details please take a look at our official here: Use direct links to view dependencies
Hope this helps.
I clicked watcher for many JIRA tickets, but I can't find a filter that shows me all the tickets I am watching. Can someone direct me to the right link or filter to look.
Type in the Jira issues search (Issues > Search for issues): key in watchedIssues()
or go directly to the URL, like to your JIRA domain http://<your-jira-domain>/jira/issues/?jql=key%20in%20watchedIssues()
There is also a gadget you can add to your JIRA homepage (dashboard): Watched Issues
From the top right button "add gadget", then on the pop-pup search for "watched" and you will get it.
If you open up a "New search". Then the filter below will show you, your watched tasks:
watcher = currentUser() AND resolution = Unresolved ORDER BY priority DESC, updated DESC
Hope it suits you :-)
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;