Query in WIQL for searching between a date time range - tfs

I am trying to define a query in WIQL to search for TFS work items between a date time range but I just couldn't get it working. It doesn't return any matches. The following is my WIQL query.
SELECT [System.State], [Custom.ExternalID], [System.Title], [System.WorkItemType] FROM WorkItems WHERE [System.TeamProject] = 'Foo_Project' AND ([System.ChangedDate] >= '04/11/2019 20:20:00Z' and [System.ChangedDate] <= '04/11/2019 20:25:59Z')
If I do a search with a single '>=' or '<=" Date/Time in my WIQL query then I would see results. That led me believe that my query is incorrect.
I am hoping to have a 2nd pair of eyes to take a look at my query and see if there's anything wrong with it.
I am using the Microsoft TFS Java SDK to connect and perform operations on TFS 2015.
https://github.com/Microsoft/team-explorer-everywhere

Related

TFS WIQL ever contains tag Syntax?

Trying to leverage the WIQL Editor feature:
'ever contains tag'
Searching Syntax, Trial and Error
Select
[System.Id],
[System.Title],
[System.State],
[System.Tags]
From WorkItems
Where [System.WorkItemType] = 'Change Request'
AND [State] <> 'Closed'
AND [State] <> 'Cancelled'
AND EVER [Tags] CONTAINS 'My Tag'
order by [Microsoft.VSTS.Common.Priority] asc,
[System.CreatedDate] desc
Expect it to return all work items that ever had a specific tag.
No, it's not able to do this through work item query at present.
Even though TFS supports a “Was Ever” operator for work item queries. But this operator is not applicable to all fields. As you can see, unlike assign to filed, the tag field only have Contians and Does Not Contain two operators.
So according to your Syntax AND EVER [Tags] CONTAINS 'My Tag'. This will not return all work items that ever had a specific tag.
For your requirement, you need to use Rest API or Client API to fetch the history of a work item and filter the tag value you have ever added in the record of all history info. It's a little bit complicated.

TFS Reporting Server: Report that shows if work items were bounced from area path to area path

Management wants to be able track workitems that are bouncing between teams. Can we get a report and the number of times a workitem changes area path?
There are probably more elegant ways to accomplish this.
In TFS 2018, assuming you don't have issues directly querying the TFS database, you could run this query against the collection database:
SELECT A.ID, A.REV, A.AreaId, B.ID, B.REV, B.AREAID
FROM vw_WorkItemCoreAll A
JOIN vw_WorkItemCoreAll B
ON B.ID = A.ID
AND B.REV = A.REV-1
WHERE A.ID = {workitemid}
AND A.REV > 1
AND A.AreaId <> B.AreaId
This will pull all work items that have a revision, align to the prior revision, and then pull out any where the area path has swapped. You can add/remove filters or columns as you see fit.

How to define query in solr

I am making a log searching service for business by solr.
I have some problem during query configuration.
I have below data.
message_type, mobile_no, ident_no, resultCode
||CCR, 01012345678, 1, null||
||CCA, null, 1, 5012||
I want to find all records with same ident_no by using mobile_no.
So, I am thinking sql statement like below.
SELECT A.*
FROM DATA
WHERE IDENT_NO IN (SELECT IDENT_NO FROM DATA WHERE MOBILE_NO = ‘01012345678’)
I defined below query for solr.
http://localhost:8983/solr/select?q={!join from=ident_no to=ident_no}mobile_no:01012345678
I didn’t receive the result by using query.
Is this query incorrect?
If you have added field mobile number in your schema.xml,then you can fetch the result by using query as mobile number : 1234567890

Jira aggregate worklogs only in specific dates range

JIRA has an excellent ability to search issues with workLog items created in specific date and by a specific user. For example:
worklogDate > 2017-04-01 AND worklogDate < 2017-05-01 AND worklogAuthor = some-user
In this search result I can see a column Time Spent - it's a total time spent on a task. How can I aggregate time from workLogs only for selected days? For example, we worked on the task in Mar and April. How to write JQL to calculate only April's time.
It is possible?
To get the time spent by the user by tasks, if you have access to the database, you can run this query:
select wl.timeworked, wl.worklogbody, wl.updateauthor, wl.updated,
u.display_name, ji.summary,
concat(concat(p.pkey,'-'),ji.issuenum) as IssueKey
from worklog wl
inner join cwd_user u
on wl.updateauthor = u.user_name
inner join jiraissue ji
on ji.id = wl.issueid
inner join project p
on (ji.project = p.id)
where issueid in (
select j.ID
from jiraissue j
inner join project p
on (j.project = p.id)
where u.user_name = 'userid')
Replace the userid with the userid of the person that submitted the worklog. Take note that for each JIRA ticket (issue), there can be multiple worklog submission by different user. This will give you every worklog submitted by the userid and it will also show you which ticket (issue) they are for. You can add in the date constraint in the where clause if you want to just query for specific timeframe. The unit of measurement for the timeworked column is in second as recorded by JIRA.
According to Time Since Issues Report if JIRA's Documentation, Time Spend is the amount of time spent on the issue. This is the aggregate amount of time that has been logged against this issue. Are you looking to aggregate the time of one person in different issues?

In TFS 2010 how can I search for a value entered into the note during check-in?

We have a Team Project Collection Source Control Setting for Check-in Notes that requires each check-in to capture a "Tracking Number". This number is external to TFS. I need to search for all the changesets that have a specific Tracking number.
The resulting changeset list tells me what to get latest version on, for a monthly deployment.
We don't use Work Items.
Question 1) Where in tfs_default_collection are the notes stored? One way to easily look would be to query with .SQL. I don't see "Note" in any of the database schemas.
Question 2) If I can't use .SQL to search, what object reference in Microsoft.TeamFoundation.VersionControl.Client.dll will give me the details of the Check-in Notes?
If I know what the changeset number is, then I can do something like this to give me the list.
-- these are all the .slq objects checked in $Release on '2013-01-28'
SELECT
chg_set.CreationDate,
chg_set.ChangeSetId,
v.FullPath
FROM dbo.tbl_ChangeSet (nolock)AS chg_set
INNER JOIN dbo.tbl_Version (nolock)AS v ON chg_set.ChangeSetId = v.VersionFrom
LEFT OUTER JOIN dbo.tbl_File (nolock) AS f ON v.FileId = f.FileId
WHERE chg_set.CreationDate >= '2013-01-31'
and FullPath like '%Tracker\Releases\2013.02.31%'
and FullPath like '%.sql%'
ORDER BY chg_set.CreationDate, v.FullPath
After some more digging into TFS_DefaultCollection I found it.
I can join these results with the query above and see exactly what I am looking for.
SELECT ReleaseNoteId, FieldName, BaseValue
from Tfs_DefaultCollection.dbo.tbl_ReleaseNoteDetails
where ReleaseNoteId in (SELECT ReleaseNoteId
FROM Tfs_DefaultCollection.dbo.tbl_ReleaseNote
where DateCreated between '2013-01-18' and '2013-02-22')
and FieldName = 'Tracker #'
and BaseValue <> '0' -- base value of zero is a merge from $Main
Thank you, in advance.

Resources