How can I search TFS for a bug report where it has a file attachment with a specific filename? I've looked at tthe query fields and none are the filename, or anything like it.
If you can access the database directly, you can query the specific collection database. The table you are looking for is dbo.[WorkItemFiles]
The ID field contains the Work Item ID and the OriginalName contains the file name.
You could use something like this:
SELECT ID
FROM [Tfs_YourCollection].[dbo].[WorkItemFiles]
WHERE OriginalName = 'Filename.extension'
AND [Historical Removed Date] IS NULL
Related
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 need to get all issues by version id. My query is like:
http://archwork:2990/jira/rest/api/2/search\?jql\=project\=GP+and+fixVersion\=10001
working fine, but I want to get issues by VERSION
Link like:
http://archwork:2990/jira/rest/api/2/search\?jql\=project\=GP+and+version\=10001
returned "Field 'version' does not exist or you do not have permission to view it."
The two built-in version fields in JIRA can be accessed in JQL as fixVersion and affectedVersion. I suspect that you want the latter.
If you have another custom field (which is a version-type field) that you want to query, the error message suggests that you may not be using the correct name for it. The best way to check this is to type your JQL into JIRA's Issue Navigator manually (in the advanced search) and to take advantage of the dropdown box with field name suggestions to get the correct field name.
One way to bypass the problem of determining the correct JQL field name (which sometimes requires quoting, which gets slightly more messy if you are also URL-encoding the result) is to simply refer to a field by the custom field ID instead.
You can find the CF ID of a field by going to Admin->Issues->Custom Fields, finding the appropriate custom field, mousing over the "Configure" link, and then looking at the URL query parameter for customFieldId, and then use the syntax cf[xxxxxx] in your JQL instead of the field name, where xxxxxx is the custom field number.
I have a full URL path for a file attachment in our JIRA installation (e.g. /jira/secure/attachment/40226/FileName.jpg). However, I'm not sure what Issue this file is currently attached to, since the attachement URLs don't contain any information about the "parent" issue. Is there any way using JQL to figure out this link? Any plugins that could help?
You can get the issue from the file location. The attachments are arranged in the following hierarchy:
attachments -> project-name -> issue key
for example, if Jira is installed at /var/atlassian/application-data and the attachments are under jira/data/attachments, for issue on project DVP, issue DRP-913, the attachment will be found at:
/var/atlassian/application-data/jira/data/attachments/DVP/DVP-913
the path you gave as an example isn't the default attachment path, that's why it doesn't have any information about the parent issue.
Another less effective way would be to query Jira's DB directly:
SELECT * FROM jiraissue WHERE id in
(SELECT issueid from changegroup where ID in
(SELECT groupid FROM changeitem WHERE NEWVALUE='<enter attachment ID>')
)
you can find more information about the DB structure here.
Let me know if you need any help.
It seems that using the DocumentQuery where using updatedMin seems to to not be working correctly. This query does find new files and folders that were created since the "when" but fails to return files that were modified, moved, trashed, or anything else since the when.
DocumentQuery myQuery = new DocumentQuery(new URL("https://docs.google.com/feeds/default/private/full/"));
myQuery.setUpdatedMin(when);
DocumentListFeed entries = getDocsService().getFeed(myQuery, DocumentListFeed.class);
I realize that the API might be changing with the upcoming Google Drive, has something changed in the interim?
To retrieve documents that have been edited since a specific date, use the edited-min query parameter.
From a DocumentQuery instance, you can use the addCustomParameter to set such a value.
query.addCustomParameter(
new Query.CustomParameter("edited-min", "<DATE_IN_RFC_3339_FORMAT>");
I have a rails application and I am trying to load data into it via PostgreSQL's COPY command. The file is CSV. The table maps to a Rails model and I need to retain the primary-key ID column so I can use model.for_each to play with the data--the table will have 5M+ rows.
My question is, how can I structure my CSV so that I can load data into the table and still allow the ID column to be there? It's a bummer because the only reason I need it is for the for_each method.
Regardless, I tried sending NULLs, as in:
NULL,col1,col2,col3,col4, etc.
But it doesn't work.
Thanks.
Passing in null for the primary key will never work no matter what options you have set for null string. You would be telling the backend to set the primary key to null which it will never allow no matter what the command to insert might be.
I really have no idea what you mean by retaining the primary key. That is something that is going be retained no matter what do. If you mean letting the DB pick the value for you and the primary key is a serial (auto-increment) then explicitly name all the columns but the primary key:
COPY country (colA, colB, colC) FROM '/usr1/proj/bray/sql/country_data'; -- leave out pkey
It also might be quicker to read the documentation on what null string options you would like to use instead of guessing possible values:
http://www.postgresql.org/docs/9.0/static/sql-copy.html
The default when using WITH CSV is an unquoted empty string, such as:
,col1,col2,col3,,col5
Which would create a record that looks like:
NULL,'col1','col2','col3',NULL,'col5'