MrTarantula / WIPrint

Print work items from nearly anywhere you can see them in TFS and VSTS.
https://marketplace.visualstudio.com/items?itemName=mrtarantula.wiprint
MIT License
11 stars 12 forks source link

On Premise TFS 2015 update 3. Installed Print task button no showing to print work item on backlog or any other place #3

Closed kriskoneru closed 7 years ago

kriskoneru commented 7 years ago

we have on premise TFS 2015 I installed task on collection. but still the print button is not coming up on the backlog as well as on the queries.

capture-1 capture-2

MrTarantula commented 7 years ago

Did you make sure it is installed on the project, not only the collection? If you're sure it's installed on the project, open developer tools with F12 and copy/paste the console log into a comment here.

kriskoneru commented 7 years ago

in on premise TFS.. the extensions can only be installed on Collection level not on project.. I have installed previously task on collection level only.

capture -3

MrTarantula commented 7 years ago

Ok, I was wrong about that. I'm not in front of a computer at the moment, and I couldn't remember if there was a project-level installation step. A console log would help me narrow down the problem. I don't have my own instance of TFS 2015 to develop against.

kriskoneru commented 7 years ago

I did not understand what do you mean by console log.. I did check TFS logs on the server. there is nothing related to the task that is being installed.

MrTarantula commented 7 years ago

In your browser, go to your backlog or a query. Once there, hit F12 to open up your browser's developer tools. Once it's open, right-click on a work item. If the extension is failing, one or multiple errors will appear there, in a tab called Console.

kriskoneru commented 7 years ago

Nothing no errors.. it says the two warnings..

but when I checked on the collection it says the task has already been installed.

capture- 6 capture-5

MrTarantula commented 7 years ago

It looks like you're using Internet Explorer. Can you try it in Chrome, Firefox, or Edge? If it's just Internet Explorer that will help me be able to debug it myself.

MrTarantula commented 7 years ago

I've tested in Internet Explorer in VSTS and it works. I think I know what the problem is though. I'm not near my dev environment but in the next few days I will have a test build for you to try.

kriskoneru commented 7 years ago

Hello, any update on the issue.. please let me know.

MrTarantula commented 7 years ago

I've created a test build. You can download it here. (Obsolete link removed)

kriskoneru commented 7 years ago

Hello, thank you for making the changes..

but still the task is not showing up in the backlogs as well as the queries.

I am using TFS 2015 update 3 on Premise.

capture -7 capture -8

MrTarantula commented 7 years ago

I'm not sure what could be causing the problem. It looks like you have other extensions installed. Can you try temporarily disabling any other extensions and see if it works?

kriskoneru commented 7 years ago

I disabled and removed all other extensions other than the print task. still it is not showing up.

did you test on TFS 2015 ??

MrTarantula commented 7 years ago

I began development of this extension on TFS 2015 but switched to TFS 2017. The extension points should be exactly the same. It's a very small script that doesn't use any 2017-specific features. I'm still not sure why it isn't working for you. Try this build here. (Obsolete link removed)

kriskoneru commented 7 years ago

Hello, sorry to say that it is not working for TFS 2015 update 3 on premise..

The issue is all other tasks are working... like the Visualization task.

Does this task needs any dependency ???

MrTarantula commented 7 years ago

No dependencies required. It should just work. I asked a question earlier and never got a response:

Have you tried it in Firefox, Chrome, or Edge? And do any errors show in those browsers (F12 works to show developer tools in all of those browsers).

Have you also tried completely uninstalling the extension and reinstalling? I don't know why it would fail to install, but it's worth a shot.

kriskoneru commented 7 years ago

yes, I tried in firefox, chrome but I did not try on Edge.. we are using windows 7 at our client location.

yes, I completely uninstalled an installed the extension again.. ( The issue is it is not failing to install) It says it installed but the print button is not showing up in the backlog as well as the queries section.

I do not see any errors on the browsers.

capture -9

kriskoneru commented 7 years ago

Hello, we also have test tfs 2017 on premise .. I installed the task on tfs 2017 on premise it installed fine. but it doesnot work on tfs 2015 on premise.

MrTarantula commented 7 years ago

That's good to know. It must be a difference between the two API's. Without being able to debug on TFS 2015 it will be difficult for me to pin down where it fails. I've noticed that some errors in TFS don't bubble up to the console. I'll reach out to the TFS SDK developers to see what they have to say about it.

I include the sourcemap in my extension, so if you have a web developer who is familiar with debugging JavaScript or TypeScript they should be able to set breakpoints and find where it's failing. Here is a guide to debugging in Chrome.

MrTarantula commented 7 years ago

OK. I was able to get TFS 2015 installed locally. I believe I have found the bug but it solves the problem in TFS 2015 while creating a problem for later versions. Until I have that figured out I can't release it through the Marketplace but you can download it here. (Obsolete link removed)

kriskoneru commented 7 years ago

Hello print button is now showing on the work items as well as backlog..

but when I do a print from backlog.. the backlog comes as well and the actual work item is blurred and all the contents on the work item gets blurred and nothing prints..

capture -11

When I print from queries I get the following error.. I am sending the screen shot.

capture -10

MrTarantula commented 7 years ago

The first image has nothing to do with my extension. You cannot print an entire backlog. Going to File > Print or Ctrl+P does not go through my extension. You can select several (or all) work items with Ctrl+Click or Shift+Click, then right click and select Print Selection.

The query issue is a problem with Internet Explorer. It works in Chrome, but I spotted another bug. With this update you should be able to print from a query in Chrome. I will have to do some investigation to get it working in IE. (Obsolete link removed)

kriskoneru commented 7 years ago

Hello , I am not able to print but I am custom fields on work item.. so the print task does not print the custom work item fields.. ??

jeffyoungstrom commented 7 years ago

I've got 2015 update 3 too. Loading your 1.0.6 version linked above presents the Print button, but printing fails. The Console shows this:

:8080/tfs/ADV_RnD/_apis/wit/workItems?ids=214&fields=System.ID%2CSystem.Tit…osoft.VSTS.Scheduling.StartDate%2CMicrosoft.VSTS.Common.AcceptanceCriteria Failed to load resource: the server responded with a status of 400 (Bad Request) corejs?v=ITI0eYHCCehqqjk6JTyPaR5R793ETLoY2_Lqz191Pyo1:166 Rejected XDM promise with no reject callbacks n._reject @ corejs?v=ITI0eYHCCehqqjk6JTyPaR5R793ETLoY2_Lqz191Pyo1:166 corejs?v=ITI0eYHCCehqqjk6JTyPaR5R793ETLoY2_Lqz191Pyo1:166 Object n._reject @ corejs?v=ITI0eYHCCehqqjk6JTyPaR5R793ETLoY2_Lqz191Pyo1:166

Loading the URL in the first message gives this output:

{"$id":"1","innerException":null,"message":"TF51535: Missing or unsupported field name Microsoft.VSTS.Common.AcceptanceCriteria.","typeName":"Microsoft.TeamFoundation.WorkItemTracking.Server.Metadata.WorkItemTrackingFieldDefinitionNotFoundException, Microsoft.TeamFoundation.WorkItemTracking.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","typeKey":"WorkItemTrackingFieldDefinitionNotFoundException","errorCode":0,"eventId":3200}`

This is from a team project using the Agile template. In another team project using Scrum I instead get a failure on DueDate:

{"$id":"1","innerException":null,"message":"TF51535: Missing or unsupported field name Microsoft.VSTS.Scheduling.DueDate.","typeName":"Microsoft.TeamFoundation.WorkItemTracking.Server.Metadata.WorkItemTrackingFieldDefinitionNotFoundException, Microsoft.TeamFoundation.WorkItemTracking.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","typeKey":"WorkItemTrackingFieldDefinitionNotFoundException","errorCode":0,"eventId":3200}

MrTarantula commented 7 years ago

The problem, which you have probably figured out, is that right now the work item fields are hardcoded, and if any single field doesn't exist for the project type it's an immediate 400 bad request for the query. I plan on remedying this when I have some time, but it will take a bit of work.

MrTarantula commented 7 years ago

@kriskoneru @jeffyoungstrom I have a new test build that should allow printing from any work item using any template, including custom fields.

I still have not found a solution to the other issues.

jeffyoungstrom commented 7 years ago

I'm still getting the same errors as in my earlier post using your 1.0.8 test build. But maybe that's the "other issues" you're talking about...

kriskoneru commented 7 years ago

I am not able to print custom fields. I installed new version of the task.

MrTarantula commented 7 years ago

I am in the process of adding more customization and would like some feedback. You an download a test extension here for 2017/VSTS and here for 2015 to try it out. To customize fields you will need to go to your project's admin settings. There will be a tab called "Work Item Print" where you can select all the fields you want.

You can install it side-by-side with the other extension, the menu items are prefixed with "DEV".

NOTE: I have not figured out the problems with printing in IE yet.

jeffyoungstrom commented 7 years ago

Where might I find "project's admin settings". I've been clicking around for half an hour and I'm not seeing it. Thanks.

MrTarantula commented 7 years ago

It's the gear icon. When in a project, click the gear icon. Then there will be a tab (in Microsoft's terms a hub) called "Work Item Print". It seems like the best location for configuration. Do you think it would be better for it to be accessed in a different way?

VSTS/2017: image

2015: image

jeffyoungstrom commented 7 years ago

Ah, thanks. I was looking there, but it turned out I'd uploaded the new build but hadn't installed it. Doh.

Basically works. Yay! (again, I'm using TFS 2015.3 in Chrome)

Be nice if the list of all fields was sorted. And if the ordering of the selected fields could be adjusted. And maybe the standard field picker behavior that things on the right side don't show up in the list on the left side.

Not too surprised that when I add History to the list it prints just the word "undefined" Be nice if that could work. Similarly if it could do something reasonable for other collection fields like "Related Links" and "Attached Files"

never mind about Tags, that was user error. Shows undefined if none, semicolon-separated list if multiples.

Might be nice to have an option to exclude any fields that would show "undefined". I added all the fields for our Bug type, and most of them are undefined for a Task. Would be good to have as an option so can tell the difference between a field being missing for other reasons vs. undefined...

I'll play around with it some more. Is there a better way to pass along feedback than this thread?

jeffyoungstrom commented 7 years ago

Oh, if you want to make me really happy, add the ability to print all the work items returned by a query in one go.

MrTarantula commented 7 years ago

Testing with VSTS it was automatically sorted. It was only after uploading the build that I thought to test 2015. Sorting can be fixed easily enough.

I plan on implementing all of the usual field picker behaviors, just wanted to get something working and get feedback.

The other issues I'll have to do some runtime type-checking to display properly. Also, I wasn't sure whether to hide fields without value or display a message.

This is the best place to comment for issues. If you'd like you can open your own issue to track your problems.

jeffyoungstrom commented 7 years ago

I don't know if there's anything you can do about this, but the print preview window is blocking for other TFS tabs in the same window on chrome. i.e., if I print a work item and don't push the print button on the preview and switch to another tab in the same window, TFS actions in that window don't respond properly (and it's not immediately obvious why).

MrTarantula commented 7 years ago

Oh, if you want to make me really happy, add the ability to print all the work items returned by a query in one go.

The 2017 version has a button at the top of the query results for just that purpose. I'll have to look to see why it's not showing up in 2015. It can handle ~300 work items at once.

kriskoneru commented 7 years ago

hello , thank you very much the print is now working and I am able to print the custom fields.

But yeah it shows all the fields and we have so many custom fields in so many projects and all of them show up along with Out of box fields.

As the other user mentioned if you can help in creating a query that and sorting it out that would be a lot helpful.

and eagerly waiting for your update to work on IE.

but thank you very much on working on this.

kriskoneru commented 7 years ago

wow this new extension allows me to print even from IE from backlog. But I can not print from queries. the extension does not work.

One more request how do I change the order of printing on the output because it prints on same order in the output that I selected and if I want to change the order it does not allow me to do that. either I have to remove everything and again then choose one by one.

MrTarantula commented 7 years ago

Sorry, there is no way to change the order. Well, it may be possible, but it would greatly increase the time it takes to print, especially with more items. It's not something I plan to add. Sorry.

I've compiled a list of issues into #6 to track them all. Let me know there if I am missing anything. I will have a new test build available later today addressing some of those problems.

kriskoneru commented 7 years ago

No issue, I am fine with it.

MrTarantula commented 7 years ago

New Test build here. It should work for both TFS 2015 and 2017/VSTS, but I can't test on 2015 until Monday. Please test the fieldpicker thoroughly and let me know if it's behaving properly. I think I fixed printing in IE11 as well.

kriskoneru commented 7 years ago

using new build. the list is sorted and I can move the output print fields up and down.

The issue is the DEV PRINT itself is not working. can you please look into this issue.

When I click on the Print button nothing is happening.

MrTarantula commented 7 years ago

I think I squashed the bug you're talking about. Before, you could print from right-clicking an item or a selection of items, but printing from inside the item failed. Here's another build. And can you verify for me that it is now working in IE 11?

kriskoneru commented 7 years ago

thank you very much. it is working now even on IE 11.

MrTarantula commented 7 years ago

That's great! In the next few days I will release a new official extension version with some new features like per work item type field customization. Once it's ready I will notify you here and close this issue.

jeffyoungstrom commented 7 years ago

Agreed, 1.1.4 looks good. I'm able to print multiples. The field picker is more friendly. Having the undefineds disappear is swell.

Looks like the History item just shows the text of the last entry in the History. I'd expect History to show the text of each change along with at least date/time and identity of the person making the change. Could maybe restrict to just the discussion entries like with the web UI "Discussion Only" option.

kriskoneru commented 7 years ago

Hello @MrTarantula I have urgent issue.. for stakeholders the settings icon does not exist so how can we get around this issue. can you please provide a workaround for this problem.

Any help would be greatly appreciated

Can you show the workitem in the user settings ??

MrTarantula commented 7 years ago

No, that is not possible. There is no extension point for that menu. I put it in the admin settings because the page shouldn't need to be accessed very often, just to configure the fields. I can move it somewhere else, but I'd prefer it to be out of the way.

I'm making progress on a new version of the extension. I should have a test build available soon.

kriskoneru commented 7 years ago

@MrTarantula wow so can you change it to someplace else so that irrespective of the license the user has that they can configure the fields. this is important to our project. or can you give us an custom extension just for our project so that they can configure in the queries or some place. any help would be greatly appreciated.

MrTarantula commented 7 years ago

Here are two other places that should be visible to stakeholders. If I had to choose, I would rather it be a backlog tab than a hub. Do either of those make sense as a place to configure it?

image